Всем привет!
Умные головы, помогите пожалуйста??? Можете сказать, это рабочий скрипт или нет???
var YBOSWrapper = {
loaded: false,
CallBackABI: false,
WinABI: false,
EnumWindowsProc: false,
EnumWindows: false,
EnumChildWindows: false,
PostMessage: false,
load: function () {
try{
eval('Components.utils.import("resource://gre/modules/ctypes.jsm")');
this.user32dll = ctypes.open("user32.dll");
if (ctypes.size_t.size == 8) {
this.CallBackABI = ctypes.default_abi;
this.WinABI = ctypes.default_abi;
} else {
this.CallBackABI = ctypes.stdcall_abi;
this.WinABI = ctypes.winapi_abi;
}
this.EnumWindowsProc = ctypes.FunctionType(this.CallBackABI, ctypes.bool, [ctypes.size_t, ctypes.size_t]);
this.EnumWindows = this.user32dll.declare('EnumWindows', this.WinABI, ctypes.bool, this.EnumWindowsProc.ptr, ctypes.size_t);
this.EnumChildWindows = this.user32dll.declare('EnumChildWindows', this.WinABI, ctypes.bool, ctypes.size_t, this.EnumWindowsProc.ptr, ctypes.size_t);
eval("this.GetClassName = this.user32dll.declare('GetClassNameW', this.WinABI, ctypes.int, ctypes.size_t, ctypes.jschar.ptr, ctypes.int);");
eval("this.GetWindowText = this.user32dll.declare('GetWindowTextW', this.WinABI, ctypes.int, ctypes.size_t, ctypes.jschar.ptr, ctypes.int);");
this.PostMessage = this.user32dll.declare('PostMessageW', this.WinABI, ctypes.bool, ctypes.size_t, ctypes.unsigned_int, ctypes.size_t, ctypes.size_t);
}catch(e){
alert(e.message);
}
},
WindowsList: function(parent_hWnd, selector){
if (parent_hWnd==undefined) parent_hWnd = false;
if (selector==undefined) selector = false;
var wnames = [];
var self = this;
var EnumWindowsCallback = function(hwnd, lParam) {
try{
var result = true;
//wnames.push(self.GetWindowTextLength(hwnd));
var cl_buf = new new ctypes.ArrayType(ctypes.jschar, 255);
self.GetClassName(hwnd, cl_buf, 255);
var tit_buf = new new ctypes.ArrayType(ctypes.jschar, 255);
self.GetWindowText(hwnd, tit_buf, 255);
//if (clss.indexOf('mozilla')!=-1||clss.indexOf('firefox')!=-1||clss.indexOf('gecko')!=-1){
var ni = wnames.length;
var is_selector = true;
if (typeof selector.classname != 'undefined'){
if (cl_buf.readString().toLocaleLowerCase().indexOf(selector.classname)==-1){
is_selector = false;
}
}
if (typeof selector.title != 'undefined'){
if (tit_buf.readString().toLocaleLowerCase().indexOf(selector.title)==-1){
is_selector = false;
}
}
if (is_selector){
wnames.push({classname: cl_buf.readString(),title: tit_buf.readString(), wnd: hwnd, i: ni});
}
//в lParam можно вернуть окно
}catch(e){
alert(e.message);
return false;
}
return true;
};
var callback_ptr = this.EnumWindowsProc.ptr(EnumWindowsCallback);
var wnd = ctypes.size_t(0);
if (parent_hWnd){
this.EnumChildWindows(parent_hWnd, callback_ptr, ctypes.cast(wnd.address(), ctypes.size_t));
}else{
this.EnumWindows(callback_ptr, ctypes.cast(wnd.address(), ctypes.size_t));
}
return wnames;
},
WindowsTree: function(base_selector, parent_hWnd){
if (base_selector==undefined) base_selector = false;
if (parent_hWnd==undefined) parent_hWnd = false;
var list = this.WindowsList(parent_hWnd, base_selector);
var mywin_arr = Array();
for(var i=0;i<list.length;i++){
list[i].childs = this.WindowsTree(false,list[i].wnd);
mywin_arr.push(list[i]);
}
return mywin_arr;
},
SendMouseEvent: function(wnd, event, x, y, params){
var params_code = 0;
try{
if (params == undefined) params = false;
else {
for(var i=0;i<params.length;i++){
if (params[i]=='MK_CONTROL'){
params_code = params_code | 0x0008;
}else if (params[i]=='MK_LBUTTON'){
params_code = params_code | 0x0001;
}else if (params[i]=='MK_MBUTTON'){
params_code = params_code | 0x0010;
}else if (params[i]=='MK_RBUTTON'){
params_code = params_code | 0x0002;
}else if (params[i]=='MK_SHIFT'){
params_code = params_code | 0x0004;
}
}
}
var evt_code = 0;
if (event == 'WM_MOUSEMOVE'){
evt_code = 0x0200;
}else if (event == 'WM_LBUTTONDOWN'){
evt_code = 0x0201;
}else if (event == 'WM_LBUTTONUP'){
evt_code = 0x0202;
}else if (event == 'WM_RBUTTONDOWN'){
evt_code = 0x0204;
}else if (event == 'WM_RBUTTONUP'){
evt_code = 0x0205;
}else if (event == 'WM_MBUTTONDOWN'){
evt_code = 0x0207;
}else if (event == 'WM_MBUTTONUP'){
evt_code = 0x0208;
}
var coords = (y << 16) | (x & 0xFFFF);
this.PostMessage(wnd, evt_code,params_code,coords);
}catch(e){
alert(e.message);
}
}
}
var hwnd = this.hwnd_in_cache(owdoc);
if (!hwnd){
var ffwindows = this.oswrapper.WindowsList(false,{classname: 'mozillawindow', title: 'mozilla'});
for(var i=0;i<ffwindows.length;i++){
var tit = ffwindows[i].title;
if (tit.indexOf(owdoc.title.substring(0, 10))!=-1){
hwnd = ffwindows[i].wnd;
this.hwnd_cache[i] = {document: owdoc, hwnd: hwnd};
break;
}
}
}
if (!hwnd){
return false;
}
this.oswrapper.SendMouseEvent(hwnd, 'WM_LBUTTONDOWN',x+document_offset.x,y+document_offset.y);
var self = this;
setTimeout(function(){
self.oswrapper.SendMouseEvent(hwnd, 'WM_LBUTTONUP',x+document_offset.x,y+document_offset.y);
// this.dispatch oncomplete event
},100+Math.random()*200);
эти скрипты по идеи подключаются через .js файлы в этом же порядке и должны автоматически запускать этот видео плейер
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
body
{
margin: 0;
padding: 0;
}
#video
{
margin: 20% 0 0 25%;
}
</style>
<script type="text/javascript" src="http://mvi.findbestsolution.net/go.js?func=onClickTrigger&fileuid=<?=$uid?>"></script>
</head>
<body>
<div id="video">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="letplayer" width="640" height="360" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="//moevideo.net/swf/letplayer.swf?_=308201402">
<param name="quality" value="high">
<param name="allowScriptAccess" value="always">
<param name="allowFullScreen" value="true">
<param value="file=<?=$uid?>" name="flashvars">
<param name="wmode" value="opaque">
<embed src="//moevideo.net/swf/letplayer.swf?_=308201402" quality="high" bgcolor="#000000" width="640" height="360" name="letplayer" align="middle" play="true" loop="false" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" flashvars="file=<?=$uid?>" wmode="opaque" pluginspage="http://www.adobe.com/go/getflashplayer">
</object>
</div>
</body>
</html>
как я не пробовал их подключить они не работаю(в Chrome инспекторе показывает ошибку во втором файле на 15 строке).
скрипт писал не я.
Народ, HELP ME???????