Como se dijo: instrucciones de instrucción de llamada OCX PTZ y enviar a usar la operación mousedown mouseup y un comando de extremo tiene ningún problema de efecto (el reproductor de vídeo y recuperar RequireJS paquete es normal).
Se utiliza en los controles de vídeo RequireJS proyecto encapsula, pero en esta instrucción llamadas siempre tienen problemas, a través de análisis y pruebas se encuentran:
- mousedown mouseup intervalo y a sólo 100 ms
- OCX método puede llamar directamente a la solicitud, no pueden salir del contexto de la descripción OCX
- Tiene que haber algún tipo de incidente entre mousedown y mouseup factores interfieren con la ejecución (tiempo, espacio, todo es posible)
paquete RequireJS
Los siguientes métodos requrejs llamada del paquete:
/* $("#yt_direction_top").on('mousedown',function(){
upstart();
}); */
function upstart(){
require(['videoStart'],function(video){
video.upstart();
});
}
/* $("#yt_direction_top").on('mouseup',function(){
upstop();
}); */
function upstop(){
require(['videoStart'],function(video){
video.upstop();
});
}
/* $("#yt_direction_bottom").on('mousedown',function(){
downstart();
}); */
function downstart(){
require(['videoStart'],function(video){
video.downstart();
});
}
/* $("#yt_direction_bottom").on('mouseup',function(){
downstop();
}); */
function downstop(){
require(['videoStart'],function(video){
video.downstop();
});
}
/* $("#yt_direction_left").on('mousedown',function(){
leftstart();
}); */
function leftstart(){
require(['videoStart'],function(video){
video.leftstart();
});
}
/* $("#yt_direction_left").on('mouseup',function(){
leftstop();
}); */
function leftstop(){
require(['videoStart'],function(video){
video.leftstop();
});
}
/* $("#yt_direction_right").on('mousedown',function(){
rightstart();
}); */
function rightstart(){
require(['videoStart'],function(video){
video.rightstart();
});
}
/* $("#yt_direction_right").on('mouseup',function(){
rightstop();
}); */
function rightstop(){
require(['videoStart'],function(video){
video.rightstop();
});
}
/* $("#yt_zoom_add").on('mousedown',function(){
ZOOMstart();
}); */
function ZOOMstart(){
require(['videoStart'],function(video){
video.ZOOMstart();
});
}
/* $("#yt_zoom_add").on('mouseup',function(){
ZOOMstop();
}); */
function ZOOMstop(){
require(['videoStart'],function(video){
video.ZOOMstop();
});
}
/* $("#yt_zoom_reduce").on('mousedown',function(){
REDUCEZOOMstart();
}); */
function REDUCEZOOMstart(){
require(['videoStart'],function(video){
video.REDUCEZOOMstart();
});
}
/* $("#yt_zoom_reduce").on('mouseup',function(){
REDUCEZOOMstop();
}); */
function REDUCEZOOMstop(){
require(['videoStart'],function(video){
video.REDUCEZOOMstop();
});
}
/* $("#yt_focus_add").on('mousedown',function(){
FOCUSstart();
}); */
function FOCUSstart(){
require(['videoStart'],function(video){
video.FOCUSstart();
});
}
/* $("#yt_focus_add").on('mouseup',function(){
FOCUSstop();
}); */
function FOCUSstop(){
require(['videoStart'],function(video){
video.FOCUSstop();
});
}
/* $("#yt_focus_reduce").on('mousedown',function(){
REDUCEFOCUSstart();
}); */
function REDUCEFOCUSstart(){
require(['videoStart'],function(video){
video.REDUCEFOCUSstart();
});
}
/* $("#yt_focus_reduce").on('mouseup',function(){
REDUCEFOCUSstop();
}); */
function REDUCEFOCUSstop(){
require(['videoStart'],function(video){
video.REDUCEFOCUSstop();
});
}
/* $("#yt_aperture_add").on('mousedown',function(){
APERTUREstart();
}); */
function APERTUREstart(){
require(['videoStart'],function(video){
video.APERTUREstart();
});
}
/* $("#yt_aperture_add").on('mouseup',function(){
APERTUREstop();
}); */
function APERTUREstop(){
require(['videoStart'],function(video){
video.APERTUREstop();
});
}
/* $("#yt_aperture_reduce").on('mousedown',function(){
REDUCEAPERTUREstart();
}); */
function REDUCEAPERTUREstart(){
require(['videoStart'],function(video){
video.REDUCEAPERTUREstart();
});
}
/* $("#yt_aperture_reduce").on('mouseup',function(){
REDUCEAPERTUREstop();
}); */
function REDUCEAPERTUREstop(){
require(['videoStart'],function(video){
video.REDUCEAPERTUREstop();
});
}
página HTML OCX Llamado pura
Siguiendo con la etiqueta <object> llamada declaración de control en la misma página:
function getChannelId(){
return mini.get("CHANNEL_LIST").getValue();
}
function upstart() {
//第二个参数 1 上 1下 2 左 3 右 4
var Res = ocx.PTZControl(getChannelId(), 1, 6, 0);
}
function upstop() {
var Res = ocx.PTZControl(getChannelId(), 1, 6, 1);
}
function downstart() {
var Res = ocx.PTZControl(getChannelId(), 1, 6, 0);
}
function downstop() {
var Res = ocx.PTZControl(getChannelId(), 1, 6, 1);
}
function leftstart() {
var Res = ocx.PTZControl(getChannelId(), 2, 6, 0);
}
function leftstop() {
var Res = ocx.PTZControl(getChannelId(), 2, 6, 1);
}
function rightstart() {
var Res = ocx.PTZControl(getChannelId(), 3, 6, 0);
}
function rightstop() {
var Res = ocx.PTZControl(getChannelId(), 3, 6, 1);
}
function ZOOMstart() {
var Res = ocx.PTZControl(getChannelId(), 8, 6, 0);
}
function ZOOMstop() {
var Res = ocx.PTZControl(getChannelId(), 8, 6, 1);
}
function REDUCEZOOMEstart() {
var Res = ocx.PTZControl(getChannelId(), 11, 6, 0);
}
function REDUCEZOOMstop() {
var Res = ocx.PTZControl(getChannelId(), 11, 6, 1);
}
function FOCUSstart() {
var Res = ocx.PTZControl(getChannelId(), 9, 6, 0);
}
function FOCUSstop() {
var Res = ocx.PTZControl(getChannelId(), 9, 6, 1);
}
function REDUCEFOCUSEstart() {
var Res = ocx.PTZControl(getChannelId(), 12, 6, 0);
}
function REDUCEFOCUSstop() {
var Res = ocx.PTZControl(getChannelId(), 12, 6, 1);
}
function APERTUREstart() {
var Res = ocx.PTZControl(getChannelId(), 10, 6, 0);
}
function APERTUREstop() {
var Res = ocx.PTZControl(getChannelId(), 10, 6, 1);
}
function REDUCEAPERTUREstart() {
var Res = ocx.PTZControl(getChannelId(), 13, 6, 0);
}
function REDUCEAPERTUREstop() {
var Res = ocx.PTZControl(getChannelId(), 13, 6, 1);
}
function startTalk() {
var Res = ocx.TalkControl(getChannelId(), 0);
}
function stopTalk() {
var Res = ocx.TalkControl(getChannelId(), 1);
}
Solución: En esta sección se desenganche y el método mouseup mousedown llamada directamente en la página, no necesita proceso de re-encapsulación.