李勇

修改接口,连接地址由外部传入完整的

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>UMD PLAYGROUND</title></head><body><div id="stage"></div><script type="text/javascript" src="test.js?8c5b5e6f30a1691a0b96"></script><script type="text/javascript" src="screenShare.js?8c5b5e6f30a1691a0b96"></script></body></html>
\ No newline at end of file
... ...
!function(e,_){"object"==typeof exports&&"object"==typeof module?module.exports=_():"function"==typeof define&&define.amd?define([],_):"object"==typeof exports?exports.share=_():e.share=_()}(this,function(){return function(e){function _(t){if(r[t])return r[t].exports;var n=r[t]={exports:{},id:t,loaded:!1};return e[t].call(n.exports,n,n.exports,_),n.loaded=!0,n.exports}var r={};return _.m=e,_.c=r,_.p="",_(0)}([function(e,_,r){e.exports=r(2)},function(e,_){"use strict";function r(e,_){if(!(e instanceof _))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var t=function(){function e(e,_){for(var r=0;r<_.length;r++){var t=_[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(_,r,t){return r&&e(_.prototype,r),t&&e(_,t),_}}(),n=function(){function e(){r(this,e),this.MAPS={}}return t(e,[{key:"on",value:function(e,_){if(e&&_){var r=this.MAPS[e];if(!r)return this.MAPS[e]=[_];r.push(_)}}},{key:"off",value:function(e,_){if(e){var r=this.MAPS[e];if(r){if(_)return r.splice(r.indexOf(_),1);r.length=0}}}},{key:"emit",value:function(e,_){if(e){var r=this.MAPS["*"];r&&r.length&&r.forEach(function(r){r(e,_)});var t=this.MAPS[e];t&&t.length&&t.forEach(function(e){e(_)})}}}]),e}(),a=n;_.default=a;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(n,"Emiter","D:/work/screenshare/src/Emiter.js"),__REACT_HOT_LOADER__.register(a,"default","D:/work/screenshare/src/Emiter.js"))})()},function(e,_,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function n(e){var _,r,t,n;t=e.length,_=new Uint8Array(3*t);var a=0;for(r=0;r<t;r++)n=e.charCodeAt(r),n>=1&&n<=127?_[a++]=n:n>2047?(_[a++]=224|n>>12&15,_[a++]=128|n>>6&63,_[a++]=128|n>>0&63):(_[a++]=192|n>>6&31,_[a++]=128|n>>0&63);return new Uint8Array(_.buffer,0,a)}function a(e){var _,r,t,n,a,s;for(_="",t=e.length,r=0;r<t;)switch(n=e[r++],n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(n);break;case 12:case 13:a=e[r++],_+=String.fromCharCode((31&n)<<6|63&a);break;case 14:a=e[r++],s=e[r++],_+=String.fromCharCode((15&n)<<12|(63&a)<<6|(63&s)<<0)}return _}function s(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=new Object;if(r.data_len=0,r.data="",r.name=e,"mov_start"==e)r.type=1;else if("mov_stop"==e)r.type=2;else if("mov_pause"==e){if(r.type=3,pos=_,pos.length>0){r.data_len=4;var t=new ArrayBuffer(r.data_len),a=new Uint32Array(t,0,1);a[0]=parseInt(pos),r.data=new Uint8Array(t,0,4)}}else if("mov_resume"==e)r.type=4;else if("mov_seek"==e){if(r.type=5,pos=_,pos.length>0){r.data_len=4;var t=new ArrayBuffer(r.data_len),a=new Uint32Array(t,0,1);a[0]=parseInt(pos),r.data=new Uint8Array(t,0,4)}}else if("ss_start"==e)r.type=6,r.data=n(_),r.data_len=r.data.length;else if("ss_stop"==e)r.type=7;else if("ss_version"==e)r.type=14;else if("get_mic"==e)r.type=26;else{if("ds_start"==e){r.type=27,r.data_len=536;var t=new ArrayBuffer(r.data_len),s=new Uint32Array(t,0,6);coordstr=_;var i=coordstr.split(",");if(4!=i.length)return;s[0]=parseInt(i[0]),s[1]=parseInt(i[1]),s[2]=parseInt(i[2]),s[3]=parseInt(i[3]);var A=new Uint8Array(t,24,256);window_name=_;for(var E=n(window_name),c=0;c<E.length;c++)A[c]=E[c];s[4]=E.length,s[5]=0;new Uint8Array(t,280,256);return r.data=new Uint8Array(t,0,r.data_len),void o(r)}if("ds_stop"==e)r.type=28;else{if("aud_start"==e){r.type=29,r.data_len=520;var t=new ArrayBuffer(r.data_len),O=new Uint32Array(t,0,1),C=_;O[0]=C.length;var S=new Uint32Array(t,4,1);S[0]=0;for(var T=new Uint8Array(t,8,256),l=n(C),c=0;c<l.length;c++)T[c]=l[c];new Uint8Array(t,264,256);return r.data=new Uint8Array(t,0,r.data_len),void o(r)}if("aud_stop"==e)r.type=30;else if("get_cam"==e)r.type=41;else{if("cam_start"==e){r.type=42,r.data_len=520;var t=new ArrayBuffer(r.data_len),f=new Uint32Array(t,0,1),R=_;f[0]=R.length;var S=new Uint32Array(t,4,1);S[0]=0;for(var I=new Uint8Array(t,8,256),U=n(R),c=0;c<U.length;c++)I[c]=U[c];new Uint8Array(t,264,256);return r.data=new Uint8Array(t,0,r.data_len),void o(r)}"cam_stop"==e?r.type=43:"set_videoparam"==e?(r.type=46,r.data=n(_),r.data_len=r.data.length):"get_videoparam"==e?(r.type=47,r.data=n(_),r.data_len=r.data.length):"start_record"==e?(r.type=48,r.data=n(_),r.data_len=r.data.length):"stop_record"==e?(r.type=49,r.data=n(_),r.data_len=r.data.length):"start_push"==e?(r.type=50,r.data=n(_),r.data_len=r.data.length):"stop_push"==e?(r.type=51,r.data=n(_),r.data_len=r.data.length):"get_rtmp_port"==e?r.type=52:"set_mic_vol"==e?(r.type=53,r.data=n(_),r.data_len=r.data.length):"get_mic_vol"==e&&(r.type=54)}}}o(r)}function o(e){var _=8+e.data_len,r=new ArrayBuffer(_),t=new Uint16Array(r,0,1),n=new Uint8Array(r,2,1),a=new Uint32Array(r,4,1);if(t[0]=e.type,n[0]=0,a[0]=e.data_len,e.data_len>0)for(var s=new Uint8Array(r,8,e.data_len),o=0;o<e.data_len;o++)s[o]=e.data[o];L&&L.send(r)}function i(){try{L&&(L.close(),L=L.onopen=L.onclose=L.onerror=L.onmessage=null,C.emit(C.CLOSE))}catch(e){console.log(e)}}function A(){i()}function E(){L&&i(),L=new WebSocket(m),p=setTimeout(function(){clearTimeout(p),i()},1500),L.timeout=1500,L.binaryType="arraybuffer",L.onopen=function(){clearTimeout(p),s("get_rtmp_port"),s("get_mic"),s("get_cam"),s("get_mic_vol"),C.emit(C.OPEN)},L.onclose=function(){i()},L.onerror=function(){i()},L.onmessage=function(e){var _=e.data;if("string"==typeof e.data)console.log("on message [string] ignore.");else{var r=new DataView(_),t=r.getUint16(0,!0);console.log("onmessage code->",t);var n=(r.getUint8(2,!0),r.getUint32(4,!0));if(t>=0&&t<S.length){S[t]}if(0==t||6==t||8==t)console.log("mov_start,mov_pause,mov_seek success");else if(10==t){if(n>36){var s=new Uint32Array(_,8,8),o="width:"+s[0]+" height:"+s[1];o="framerate:"+s[2]+" duration:"+s[3],o="playpos:"+s[4]+" filesize:"+s[5],T=o;var i=s[6],A=new Uint8Array(_,40,i),E=a(A);T.filename=E,C.emit(C.MOVIE_INFO_CHANGE,T)}}else if(11==t)console.log("ss_start success"),C.emit(C.SS_START);else if(24<=t&&26>=t){if(n>=4){var c=r.getUint32(8,!0);l=c.toString(),C.emit(C.VERSION_INFO_CHANGE,l)}}else if(55==t)console.log("ds_start success");else if(59==t)console.log("as start success");else if(83==t){if(console.log("get camera sucess"),n>4){var O=r.getUint32(8,!0),L=12;f.length=0;for(var d=0;d<O;d++){var g=r.getUint32(L,!0);L+=4;var m=new Uint8Array(_,L,g-1);L+=g;var p=a(m);f.push(p)}C.emit(C.CAMERA_INFO_CHANGE,f)}}else if(53==t){if(n>4){var y=r.getUint32(8,!0),L=12;R.length=0;for(var d=0;d<y;d++){var D=r.getUint32(L,!0);L+=4;var h=new Uint8Array(_,L,D-1);L+=D;var p=a(h);R.push(p)}C.emit(C.MIC_INFO_CHANGE,R)}}else if(85==t)console.log("cam_share success");else if(95==t){console.log("get_videoparam success");var v=new Uint8Array(_,8,_.byteLength-8-1),p=a(v);I=p,C.emit(C.VIDEO_INFO_CHANGE,I)}else if(105==t){console.log("get_rtmp_port_success");var v=new Uint8Array(_,8,_.byteLength-8-1),p=a(v);U=p,C.emit(C.RTMP_PORT_CHANGE,U)}else if(109==t){console.log("get_mic_vol success");var v=new Uint8Array(_,8,_.byteLength-8-1),p=a(v);u=p,C.emit(C.MIC_VOL_CHANGE,u)}else if(111<=t&&114>=t){var v=new Uint8Array(_,8,_.byteLength-8),P=a(v);console.log("url->",P)}else if(13==t)C.emit(C.SS_STOP);else{var v=new Uint8Array(_,8,_.byteLength-8),p=a(v);console.log("data ->",p)}}}}Object.defineProperty(_,"__esModule",{value:!0});var c=r(1),O=t(c),C=new O.default,S=["MOV_START_SUC","MOV_START_FAIL","MOV_STOP_SUC","MOV_STOP_FAIL","MOV_PAUSE_SUC","MOV_PAUSE_FAIL","MOV_RESUME_SUC","MOV_RESUME_FAIL","MOV_SEEK_SUC","MOV_SEEK_FAIL","MOV_PROPERTY","SS_START_SUC","SS_START_FAIL","SS_STOP_SUC","SS_STOP_FAIL","REC_START_SUC","REC_START_FAIL","REC_STOP_SUC","REC_STOP_FAIL","REC_PAUSE_SUC","REC_PAUSE_FAIL","REC_RESUME_SUC","REC_RESUME_FAIL","MOV_PLAY_FINISH","MOV_VERSION","SS_VERSION","REC_VERSION","MOV_SELECT_FILE_CANCEL","QAV_LOGIN_SUC","QAV_LOGIN_FAIL","QAV_LOGOUT_SUC","QAV_LOGOUT_FAIL","QAV_ENTERROOM_SUC","QAV_ENTERROOM_FAIL","QAV_LEAVEROOM_SUC","QAV_LEAVEROOM_FAIL","QAV_OPEN_MIC_SUC","QAV_OPEN_MIC_FAIL","QAV_OPEN_MIC_NODEV","QAV_CLOSE_MIC_SUC","QAV_CLOSE_MIC_FAIL","QAV_CLOSE_MIC_NODEV","QAV_OPEN_PLAYER_SUC","QAV_OPEN_PLAYER_FAIL","QAV_OPEN_PLAYER_NODEV","QAV_CLOSE_PLAYER_SUC","QAV_CLOSE_PLAYER_FAIL","QAV_CLOSE_PLAYER_NODEV","QAV_MUTE_AUDIO_SUC","QAV_MUTE_AUDIO_FAIL","QAV_UNMUTE_AUDIO_SUC","QAV_UNMUTE_AUDIO_FAIL","REC_SAVE_FILE_CANCEL","GET_MIC_SUC","GET_MIC_FAIL","DS_START_SUC","DS_START_FAIL","DS_STOP_SUC","DS_STOP_FAIL","AUD_START_SUC","AUD_START_FAIL","AUD_STOP_SUC","AUD_STOP_FAIL","AUD_DATA","SS_DATA","MOV_DATA","PEN_START_SUC","PEN_START_FAIL","PEN_STOP_SUC","PEN_STOP_FAIL","PEN_VERSION","QAV_DEVICE_SUC","QAV_DEVICE_FAIL","CBD_QUERY_SUC","CBD_QUERY_FAIL","CBD_GET_SUC","CBD_GET_FAIL","FILE_GET_SUC","FILE_GET_FAIL","FILE_SET_SUC","FILE_SET_FAIL","RESTART_SUC","RESTART_FAIL","GET_CAM_SUC","GET_CAM_FAIL","CAM_START_SUC","CAM_START_FAIL","CAM_STOP_SUC","CAM_STOP_FAIL","SWITCH_SCENE_SUC","SWITCH_SCENE_FAIL","PUSH_STREAM_FAIL","SHOW_UI_SUC","SET_VIDEO_PARAM_SUC","SET_VIDEO_PARAM_FAIL","GET_VIDEO_PARAM_SUC","GET_VIDEO_PARAM_FAIL","START_RECORD_SUC","START_RECORD_FAIL","STOP_RECORD_SUC","STOP_RECORD_FAIL","START_PUSH_SUC","START_PUSH_FAIL","STOP_PUSH_SUC","STOP_PUSH_FAIL","GET_RTMP_PORT_SUC","GET_RTMP_PORT_FAIL","SET_MIC_VOL_SUC","SET_MIC_VOL_FAIL","GET_MIC_VOL_SUC","GET_MIC_VOL_FAIL","RTMP_CONNECTING","RTMP_CONNECT_SUC","RTMP_CONNECT_FAIL","RTMP_CONNECT_CLOSED"],T=null,l="",f=[],R=[],I="",U="",u="",L=null,d="127.0.0.1",g=8090,m="ws://127.0.0.1:8090",p=0;C.infos={movieInfo:T,versionInfo:l,cameraInfo:f,micInfo:R,videoInfo:I,rtmpPort:U,micVol:u},C.MOVIE_INFO_CHANGE="MOVIE_INFO_CHANGE",C.VERSION_INFO_CHANGE="VERSION_INFO_CHANGE",C.CAMERA_INFO_CHANGE="CAMERA_INFO_CHANGE",C.MIC_INFO_CHANGE="MIC_INFO_CHANGE",C.VIDEO_INFO_CHANGE="VIDEO_INFO_CHANGE",C.RTMP_PORT_CHANGE="RTMP_PORT_CHANGE",C.MIC_VOL_CHANGE="MIC_VOL_CHANGE",C.SS_START="SS_START",C.SS_STOP="SS_STOP",C.OPEN="OPEN",C.CLOSE="CLOSE",C.ERROR="ERROR",C.getRTMPPort=function(){s("get_rtmp_port")},C.getMicInfo=function(){s("get_mic")},C.getCamInfo=function(){s("get_cam")},C.getMicVol=function(){s("get_mic_vol")},C.start=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"127.0.0.1",_=arguments[1];d=e,g=_,E()},C.startConnect=function(e){m=e,E()},C.stop=function(){A()},C.startShareScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";s("ss_start",e)},C.stopShareScreen=function(){s("ss_stop")};var y=C;_.default=y;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"e","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(n,"utf16to8","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(a,"utf8to16","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(S,"CODE","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(s,"sendCommand","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(o,"_sendCommand","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(T,"movieInfo","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(l,"versionInfo","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(f,"cameraInfo","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(R,"micInfo","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(I,"videoInfo","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(U,"rtmpPort","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(u,"micVol","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(L,"ws","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(d,"host","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(g,"port","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(m,"fullUrl","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(p,"wstimer","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(i,"clear","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(A,"stop","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(E,"start","D:/work/screenshare/src/main.js"),__REACT_HOT_LOADER__.register(y,"default","D:/work/screenshare/src/main.js"))})()}])});
\ No newline at end of file
... ...
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.share=t():e.share=t()}(this,function(){return function(e){function t(n){if(_[n])return _[n].exports;var a=_[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var _={};return t.m=e,t.c=_,t.p="",t(0)}([function(e,t,_){e.exports=_(2)},function(e,t){"use strict";function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var _=0;_<t.length;_++){var n=t[_];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,_,n){return _&&e(t.prototype,_),n&&e(t,n),t}}(),a=function(){function e(){_(this,e),this.MAPS={}}return n(e,[{key:"on",value:function(e,t){if(e&&t){var _=this.MAPS[e];if(!_)return this.MAPS[e]=[t];_.push(t)}}},{key:"off",value:function(e,t){if(e){var _=this.MAPS[e];if(_){if(t)return _.splice(_.indexOf(t),1);_.length=0}}}},{key:"emit",value:function(e,t){if(e){var _=this.MAPS["*"];_&&_.length&&_.forEach(function(_){_(e,t)});var n=this.MAPS[e];n&&n.length&&n.forEach(function(e){e(t)})}}}]),e}();t.default=a},function(e,t,_){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t,_,n,a;n=e.length,t=new Uint8Array(3*n);var r=0;for(_=0;_<n;_++)a=e.charCodeAt(_),a>=1&&a<=127?t[r++]=a:a>2047?(t[r++]=224|a>>12&15,t[r++]=128|a>>6&63,t[r++]=128|a>>0&63):(t[r++]=192|a>>6&31,t[r++]=128|a>>0&63);return new Uint8Array(t.buffer,0,r)}function r(e){var t,_,n,a,r,o;for(t="",n=e.length,_=0;_<n;)switch(a=e[_++],a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(a);break;case 12:case 13:r=e[_++],t+=String.fromCharCode((31&a)<<6|63&r);break;case 14:r=e[_++],o=e[_++],t+=String.fromCharCode((15&a)<<12|(63&r)<<6|(63&o)<<0)}return t}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",_=new Object;if(_.data_len=0,_.data="",_.name=e,"mov_start"==e)_.type=1;else if("mov_stop"==e)_.type=2;else if("mov_pause"==e){if(_.type=3,pos=t,pos.length>0){_.data_len=4;var n=new ArrayBuffer(_.data_len),r=new Uint32Array(n,0,1);r[0]=parseInt(pos),_.data=new Uint8Array(n,0,4)}}else if("mov_resume"==e)_.type=4;else if("mov_seek"==e){if(_.type=5,pos=t,pos.length>0){_.data_len=4;var n=new ArrayBuffer(_.data_len),r=new Uint32Array(n,0,1);r[0]=parseInt(pos),_.data=new Uint8Array(n,0,4)}}else if("ss_start"==e)_.type=6,_.data=a(t),_.data_len=_.data.length;else if("ss_stop"==e)_.type=7;else if("ss_version"==e)_.type=14;else if("get_mic"==e)_.type=26;else{if("ds_start"==e){_.type=27,_.data_len=536;var n=new ArrayBuffer(_.data_len),o=new Uint32Array(n,0,6);coordstr=t;var i=coordstr.split(",");if(4!=i.length)return;o[0]=parseInt(i[0]),o[1]=parseInt(i[1]),o[2]=parseInt(i[2]),o[3]=parseInt(i[3]);var s=new Uint8Array(n,24,256);window_name=t;for(var S=a(window_name),E=0;E<S.length;E++)s[E]=S[E];o[4]=S.length,o[5]=0;new Uint8Array(n,280,256);return _.data=new Uint8Array(n,0,_.data_len),void A(_)}if("ds_stop"==e)_.type=28;else{if("aud_start"==e){_.type=29,_.data_len=520;var n=new ArrayBuffer(_.data_len),l=new Uint32Array(n,0,1),C=t;l[0]=C.length;var f=new Uint32Array(n,4,1);f[0]=0;for(var c=new Uint8Array(n,8,256),O=a(C),E=0;E<O.length;E++)c[E]=O[E];new Uint8Array(n,264,256);return _.data=new Uint8Array(n,0,_.data_len),void A(_)}if("aud_stop"==e)_.type=30;else if("get_cam"==e)_.type=41;else{if("cam_start"==e){_.type=42,_.data_len=520;var n=new ArrayBuffer(_.data_len),I=new Uint32Array(n,0,1),T=t;I[0]=T.length;var f=new Uint32Array(n,4,1);f[0]=0;for(var U=new Uint8Array(n,8,256),u=a(T),E=0;E<u.length;E++)U[E]=u[E];new Uint8Array(n,264,256);return _.data=new Uint8Array(n,0,_.data_len),void A(_)}"cam_stop"==e?_.type=43:"set_videoparam"==e?(_.type=46,_.data=a(t),_.data_len=_.data.length):"get_videoparam"==e?(_.type=47,_.data=a(t),_.data_len=_.data.length):"start_record"==e?(_.type=48,_.data=a(t),_.data_len=_.data.length):"stop_record"==e?(_.type=49,_.data=a(t),_.data_len=_.data.length):"start_push"==e?(_.type=50,_.data=a(t),_.data_len=_.data.length):"stop_push"==e?(_.type=51,_.data=a(t),_.data_len=_.data.length):"get_rtmp_port"==e?_.type=52:"set_mic_vol"==e?(_.type=53,_.data=a(t),_.data_len=_.data.length):"get_mic_vol"==e&&(_.type=54)}}}A(_)}function A(e){var t=8+e.data_len,_=new ArrayBuffer(t),n=new Uint16Array(_,0,1),a=new Uint8Array(_,2,1),r=new Uint32Array(_,4,1);if(n[0]=e.type,a[0]=0,r[0]=e.data_len,e.data_len>0)for(var o=new Uint8Array(_,8,e.data_len),A=0;A<e.data_len;A++)o[A]=e.data[A];R&&R.send(_)}function i(){try{R&&(R.close(),R=R.onopen=R.onclose=R.onerror=R.onmessage=null,C.emit(C.CLOSE))}catch(e){console.log(e)}}function s(){i()}function S(){R&&i(),R=new WebSocket("ws://"+p+":"+L),g=setTimeout(function(){clearTimeout(g),i()},1500),R.timeout=1500,R.binaryType="arraybuffer",R.onopen=function(){clearTimeout(g),o("get_rtmp_port"),o("get_mic"),o("get_cam"),o("get_mic_vol"),C.emit(C.OPEN)},R.onclose=function(){i()},R.onerror=function(){i()},R.onmessage=function(e){var t=e.data;if("string"==typeof e.data)console.log("on message [string] ignore.");else{var _=new DataView(t),n=_.getUint16(0,!0);console.log("onmessage code->",n);var a=(_.getUint8(2,!0),_.getUint32(4,!0));if(n>=0&&n<f.length){f[n]}if(0==n||6==n||8==n)console.log("mov_start,mov_pause,mov_seek success");else if(10==n){if(a>36){var o=new Uint32Array(t,8,8),A="width:"+o[0]+" height:"+o[1];A="framerate:"+o[2]+" duration:"+o[3],A="playpos:"+o[4]+" filesize:"+o[5],c=A;var i=o[6],s=new Uint8Array(t,40,i),S=r(s);c.filename=S,C.emit(C.MOVIE_INFO_CHANGE,c)}}else if(11==n)console.log("ss_start success"),C.emit(C.SS_START);else if(24<=n&&26>=n){if(a>=4){var E=_.getUint32(8,!0);O=E.toString(),C.emit(C.VERSION_INFO_CHANGE,O)}}else if(55==n)console.log("ds_start success");else if(59==n)console.log("as start success");else if(83==n){if(console.log("get camera sucess"),a>4){var l=_.getUint32(8,!0),R=12;I.length=0;for(var p=0;p<l;p++){var L=_.getUint32(R,!0);R+=4;var g=new Uint8Array(t,R,L-1);R+=L;var y=r(g);I.push(y)}C.emit(C.CAMERA_INFO_CHANGE,I)}}else if(53==n){if(a>4){var v=_.getUint32(8,!0),R=12;T.length=0;for(var p=0;p<v;p++){var M=_.getUint32(R,!0);R+=4;var P=new Uint8Array(t,R,M-1);R+=M;var y=r(P);T.push(y)}C.emit(C.MIC_INFO_CHANGE,T)}}else if(85==n)console.log("cam_share success");else if(95==n){console.log("get_videoparam success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);U=y,C.emit(C.VIDEO_INFO_CHANGE,U)}else if(105==n){console.log("get_rtmp_port_success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);u=y,C.emit(C.RTMP_PORT_CHANGE,u)}else if(109==n){console.log("get_mic_vol success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);d=y,C.emit(C.MIC_VOL_CHANGE,d)}else if(111<=n&&114>=n){var N=new Uint8Array(t,8,t.byteLength-8),V=r(N);console.log("url->",V)}else if(13==n)C.emit(C.SS_STOP);else{var N=new Uint8Array(t,8,t.byteLength-8),y=r(N);console.log("data ->",y)}}}}Object.defineProperty(t,"__esModule",{value:!0});var E=_(1),l=n(E),C=new l.default,f=["MOV_START_SUC","MOV_START_FAIL","MOV_STOP_SUC","MOV_STOP_FAIL","MOV_PAUSE_SUC","MOV_PAUSE_FAIL","MOV_RESUME_SUC","MOV_RESUME_FAIL","MOV_SEEK_SUC","MOV_SEEK_FAIL","MOV_PROPERTY","SS_START_SUC","SS_START_FAIL","SS_STOP_SUC","SS_STOP_FAIL","REC_START_SUC","REC_START_FAIL","REC_STOP_SUC","REC_STOP_FAIL","REC_PAUSE_SUC","REC_PAUSE_FAIL","REC_RESUME_SUC","REC_RESUME_FAIL","MOV_PLAY_FINISH","MOV_VERSION","SS_VERSION","REC_VERSION","MOV_SELECT_FILE_CANCEL","QAV_LOGIN_SUC","QAV_LOGIN_FAIL","QAV_LOGOUT_SUC","QAV_LOGOUT_FAIL","QAV_ENTERROOM_SUC","QAV_ENTERROOM_FAIL","QAV_LEAVEROOM_SUC","QAV_LEAVEROOM_FAIL","QAV_OPEN_MIC_SUC","QAV_OPEN_MIC_FAIL","QAV_OPEN_MIC_NODEV","QAV_CLOSE_MIC_SUC","QAV_CLOSE_MIC_FAIL","QAV_CLOSE_MIC_NODEV","QAV_OPEN_PLAYER_SUC","QAV_OPEN_PLAYER_FAIL","QAV_OPEN_PLAYER_NODEV","QAV_CLOSE_PLAYER_SUC","QAV_CLOSE_PLAYER_FAIL","QAV_CLOSE_PLAYER_NODEV","QAV_MUTE_AUDIO_SUC","QAV_MUTE_AUDIO_FAIL","QAV_UNMUTE_AUDIO_SUC","QAV_UNMUTE_AUDIO_FAIL","REC_SAVE_FILE_CANCEL","GET_MIC_SUC","GET_MIC_FAIL","DS_START_SUC","DS_START_FAIL","DS_STOP_SUC","DS_STOP_FAIL","AUD_START_SUC","AUD_START_FAIL","AUD_STOP_SUC","AUD_STOP_FAIL","AUD_DATA","SS_DATA","MOV_DATA","PEN_START_SUC","PEN_START_FAIL","PEN_STOP_SUC","PEN_STOP_FAIL","PEN_VERSION","QAV_DEVICE_SUC","QAV_DEVICE_FAIL","CBD_QUERY_SUC","CBD_QUERY_FAIL","CBD_GET_SUC","CBD_GET_FAIL","FILE_GET_SUC","FILE_GET_FAIL","FILE_SET_SUC","FILE_SET_FAIL","RESTART_SUC","RESTART_FAIL","GET_CAM_SUC","GET_CAM_FAIL","CAM_START_SUC","CAM_START_FAIL","CAM_STOP_SUC","CAM_STOP_FAIL","SWITCH_SCENE_SUC","SWITCH_SCENE_FAIL","PUSH_STREAM_FAIL","SHOW_UI_SUC","SET_VIDEO_PARAM_SUC","SET_VIDEO_PARAM_FAIL","GET_VIDEO_PARAM_SUC","GET_VIDEO_PARAM_FAIL","START_RECORD_SUC","START_RECORD_FAIL","STOP_RECORD_SUC","STOP_RECORD_FAIL","START_PUSH_SUC","START_PUSH_FAIL","STOP_PUSH_SUC","STOP_PUSH_FAIL","GET_RTMP_PORT_SUC","GET_RTMP_PORT_FAIL","SET_MIC_VOL_SUC","SET_MIC_VOL_FAIL","GET_MIC_VOL_SUC","GET_MIC_VOL_FAIL","RTMP_CONNECTING","RTMP_CONNECT_SUC","RTMP_CONNECT_FAIL","RTMP_CONNECT_CLOSED"],c=null,O="",I=[],T=[],U="",u="",d="",R=null,p="127.0.0.1",L=8090,g=0;C.infos={movieInfo:c,versionInfo:O,cameraInfo:I,micInfo:T,videoInfo:U,rtmpPort:u,micVol:d},C.MOVIE_INFO_CHANGE="MOVIE_INFO_CHANGE",C.VERSION_INFO_CHANGE="VERSION_INFO_CHANGE",C.CAMERA_INFO_CHANGE="CAMERA_INFO_CHANGE",C.MIC_INFO_CHANGE="MIC_INFO_CHANGE",C.VIDEO_INFO_CHANGE="VIDEO_INFO_CHANGE",C.RTMP_PORT_CHANGE="RTMP_PORT_CHANGE",C.MIC_VOL_CHANGE="MIC_VOL_CHANGE",C.SS_START="SS_START",C.SS_STOP="SS_STOP",C.OPEN="OPEN",C.CLOSE="CLOSE",C.ERROR="ERROR",C.getRTMPPort=function(){o("get_rtmp_port")},C.getMicInfo=function(){o("get_mic")},C.getCamInfo=function(){o("get_cam")},C.getMicVol=function(){o("get_mic_vol")},C.start=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"127.0.0.1",t=arguments[1];p=e,L=t,S()},C.stop=function(){s()},C.startShareScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o("ss_start",e)},C.stopShareScreen=function(){o("ss_stop")},t.default=C}])});
\ No newline at end of file
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.share=t():e.share=t()}(this,function(){return function(e){function t(n){if(_[n])return _[n].exports;var a=_[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var _={};return t.m=e,t.c=_,t.p="",t(0)}([function(e,t,_){e.exports=_(3)},function(e,t){"use strict";function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var _=0;_<t.length;_++){var n=t[_];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,_,n){return _&&e(t.prototype,_),n&&e(t,n),t}}(),a=function(){function e(){_(this,e),this.MAPS={}}return n(e,[{key:"on",value:function(e,t){if(e&&t){var _=this.MAPS[e];if(!_)return this.MAPS[e]=[t];_.push(t)}}},{key:"off",value:function(e,t){if(e){var _=this.MAPS[e];if(_){if(t)return _.splice(_.indexOf(t),1);_.length=0}}}},{key:"emit",value:function(e,t){if(e){var _=this.MAPS["*"];_&&_.length&&_.forEach(function(_){_(e,t)});var n=this.MAPS[e];n&&n.length&&n.forEach(function(e){e(t)})}}}]),e}();t.default=a},function(e,t,_){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t,_,n,a;n=e.length,t=new Uint8Array(3*n);var r=0;for(_=0;_<n;_++)a=e.charCodeAt(_),a>=1&&a<=127?t[r++]=a:a>2047?(t[r++]=224|a>>12&15,t[r++]=128|a>>6&63,t[r++]=128|a>>0&63):(t[r++]=192|a>>6&31,t[r++]=128|a>>0&63);return new Uint8Array(t.buffer,0,r)}function r(e){var t,_,n,a,r,o;for(t="",n=e.length,_=0;_<n;)switch(a=e[_++],a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(a);break;case 12:case 13:r=e[_++],t+=String.fromCharCode((31&a)<<6|63&r);break;case 14:r=e[_++],o=e[_++],t+=String.fromCharCode((15&a)<<12|(63&r)<<6|(63&o)<<0)}return t}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",_=new Object;if(_.data_len=0,_.data="",_.name=e,"mov_start"==e)_.type=1;else if("mov_stop"==e)_.type=2;else if("mov_pause"==e){if(_.type=3,pos=t,pos.length>0){_.data_len=4;var n=new ArrayBuffer(_.data_len),r=new Uint32Array(n,0,1);r[0]=parseInt(pos),_.data=new Uint8Array(n,0,4)}}else if("mov_resume"==e)_.type=4;else if("mov_seek"==e){if(_.type=5,pos=t,pos.length>0){_.data_len=4;var n=new ArrayBuffer(_.data_len),r=new Uint32Array(n,0,1);r[0]=parseInt(pos),_.data=new Uint8Array(n,0,4)}}else if("ss_start"==e)_.type=6,_.data=a(t),_.data_len=_.data.length;else if("ss_stop"==e)_.type=7;else if("ss_version"==e)_.type=14;else if("get_mic"==e)_.type=26;else{if("ds_start"==e){_.type=27,_.data_len=536;var n=new ArrayBuffer(_.data_len),o=new Uint32Array(n,0,6);coordstr=t;var A=coordstr.split(",");if(4!=A.length)return;o[0]=parseInt(A[0]),o[1]=parseInt(A[1]),o[2]=parseInt(A[2]),o[3]=parseInt(A[3]);var s=new Uint8Array(n,24,256);window_name=t;for(var S=a(window_name),l=0;l<S.length;l++)s[l]=S[l];o[4]=S.length,o[5]=0;new Uint8Array(n,280,256);return _.data=new Uint8Array(n,0,_.data_len),void i(_)}if("ds_stop"==e)_.type=28;else{if("aud_start"==e){_.type=29,_.data_len=520;var n=new ArrayBuffer(_.data_len),E=new Uint32Array(n,0,1),f=t;E[0]=f.length;var c=new Uint32Array(n,4,1);c[0]=0;for(var C=new Uint8Array(n,8,256),O=a(f),l=0;l<O.length;l++)C[l]=O[l];new Uint8Array(n,264,256);return _.data=new Uint8Array(n,0,_.data_len),void i(_)}if("aud_stop"==e)_.type=30;else if("get_cam"==e)_.type=41;else{if("cam_start"==e){_.type=42,_.data_len=520;var n=new ArrayBuffer(_.data_len),u=new Uint32Array(n,0,1),T=t;u[0]=T.length;var c=new Uint32Array(n,4,1);c[0]=0;for(var I=new Uint8Array(n,8,256),U=a(T),l=0;l<U.length;l++)I[l]=U[l];new Uint8Array(n,264,256);return _.data=new Uint8Array(n,0,_.data_len),void i(_)}"cam_stop"==e?_.type=43:"set_videoparam"==e?(_.type=46,_.data=a(t),_.data_len=_.data.length):"get_videoparam"==e?(_.type=47,_.data=a(t),_.data_len=_.data.length):"start_record"==e?(_.type=48,_.data=a(t),_.data_len=_.data.length):"stop_record"==e?(_.type=49,_.data=a(t),_.data_len=_.data.length):"start_push"==e?(_.type=50,_.data=a(t),_.data_len=_.data.length):"stop_push"==e?(_.type=51,_.data=a(t),_.data_len=_.data.length):"get_rtmp_port"==e?_.type=52:"set_mic_vol"==e?(_.type=53,_.data=a(t),_.data_len=_.data.length):"get_mic_vol"==e&&(_.type=54)}}}i(_)}function i(e){var t=8+e.data_len,_=new ArrayBuffer(t),n=new Uint16Array(_,0,1),a=new Uint8Array(_,2,1),r=new Uint32Array(_,4,1);if(n[0]=e.type,a[0]=0,r[0]=e.data_len,e.data_len>0)for(var o=new Uint8Array(_,8,e.data_len),i=0;i<e.data_len;i++)o[i]=e.data[i];R&&R.send(_)}function A(){try{R&&(R.close(),R=R.onopen=R.onclose=R.onerror=R.onmessage=null,f.emit(f.CLOSE))}catch(e){console.log(e)}}function s(){A()}function S(){R&&A(),R=new WebSocket("ws://"+g+":"+p),L=setTimeout(function(){clearTimeout(L),A()},1500),R.timeout=1500,R.binaryType="arraybuffer",R.onopen=function(){clearTimeout(L),o("get_rtmp_port"),o("get_mic"),o("get_cam"),o("get_mic_vol"),f.emit(f.OPEN)},R.onclose=function(){A()},R.onerror=function(){A()},R.onmessage=function(e){var t=e.data;if("string"==typeof e.data)console.log("on message [string] ignore.");else{var _=new DataView(t),n=_.getUint16(0,!0);console.log("onmessage code->",n);var a=(_.getUint8(2,!0),_.getUint32(4,!0));if(n>=0&&n<c.length){c[n]}if(0==n||6==n||8==n)console.log("mov_start,mov_pause,mov_seek success");else if(10==n){if(a>36){var o=new Uint32Array(t,8,8),i="width:"+o[0]+" height:"+o[1];i="framerate:"+o[2]+" duration:"+o[3],i="playpos:"+o[4]+" filesize:"+o[5],C=i;var A=o[6],s=new Uint8Array(t,40,A),S=r(s);C.filename=S,f.emit(f.MOVIE_INFO_CHANGE,C)}}else if(11==n)console.log("ss_start success"),f.emit(f.SS_START);else if(24<=n&&26>=n){if(a>=4){var l=_.getUint32(8,!0);O=l.toString(),f.emit(f.VERSION_INFO_CHANGE,O)}}else if(55==n)console.log("ds_start success");else if(59==n)console.log("as start success");else if(83==n){if(console.log("get camera sucess"),a>4){var E=_.getUint32(8,!0),R=12;u.length=0;for(var g=0;g<E;g++){var p=_.getUint32(R,!0);R+=4;var L=new Uint8Array(t,R,p-1);R+=p;var y=r(L);u.push(y)}f.emit(f.CAMERA_INFO_CHANGE,u)}}else if(53==n){if(a>4){var P=_.getUint32(8,!0),R=12;T.length=0;for(var g=0;g<P;g++){var v=_.getUint32(R,!0);R+=4;var M=new Uint8Array(t,R,v-1);R+=v;var y=r(M);T.push(y)}f.emit(f.MIC_INFO_CHANGE,T)}}else if(85==n)console.log("cam_share success");else if(95==n){console.log("get_videoparam success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);I=y,f.emit(f.VIDEO_INFO_CHANGE,I)}else if(105==n){console.log("get_rtmp_port_success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);U=y,f.emit(f.RTMP_PORT_CHANGE,U)}else if(109==n){console.log("get_mic_vol success");var N=new Uint8Array(t,8,t.byteLength-8-1),y=r(N);d=y,f.emit(f.MIC_VOL_CHANGE,d)}else if(111<=n&&114>=n){var N=new Uint8Array(t,8,t.byteLength-8),V=r(N);console.log("url->",V)}else if(13==n)f.emit(f.SS_STOP);else{var N=new Uint8Array(t,8,t.byteLength-8),y=r(N);console.log("data ->",y)}}}}Object.defineProperty(t,"__esModule",{value:!0});var l=_(1),E=n(l),f=new E.default,c=["MOV_START_SUC","MOV_START_FAIL","MOV_STOP_SUC","MOV_STOP_FAIL","MOV_PAUSE_SUC","MOV_PAUSE_FAIL","MOV_RESUME_SUC","MOV_RESUME_FAIL","MOV_SEEK_SUC","MOV_SEEK_FAIL","MOV_PROPERTY","SS_START_SUC","SS_START_FAIL","SS_STOP_SUC","SS_STOP_FAIL","REC_START_SUC","REC_START_FAIL","REC_STOP_SUC","REC_STOP_FAIL","REC_PAUSE_SUC","REC_PAUSE_FAIL","REC_RESUME_SUC","REC_RESUME_FAIL","MOV_PLAY_FINISH","MOV_VERSION","SS_VERSION","REC_VERSION","MOV_SELECT_FILE_CANCEL","QAV_LOGIN_SUC","QAV_LOGIN_FAIL","QAV_LOGOUT_SUC","QAV_LOGOUT_FAIL","QAV_ENTERROOM_SUC","QAV_ENTERROOM_FAIL","QAV_LEAVEROOM_SUC","QAV_LEAVEROOM_FAIL","QAV_OPEN_MIC_SUC","QAV_OPEN_MIC_FAIL","QAV_OPEN_MIC_NODEV","QAV_CLOSE_MIC_SUC","QAV_CLOSE_MIC_FAIL","QAV_CLOSE_MIC_NODEV","QAV_OPEN_PLAYER_SUC","QAV_OPEN_PLAYER_FAIL","QAV_OPEN_PLAYER_NODEV","QAV_CLOSE_PLAYER_SUC","QAV_CLOSE_PLAYER_FAIL","QAV_CLOSE_PLAYER_NODEV","QAV_MUTE_AUDIO_SUC","QAV_MUTE_AUDIO_FAIL","QAV_UNMUTE_AUDIO_SUC","QAV_UNMUTE_AUDIO_FAIL","REC_SAVE_FILE_CANCEL","GET_MIC_SUC","GET_MIC_FAIL","DS_START_SUC","DS_START_FAIL","DS_STOP_SUC","DS_STOP_FAIL","AUD_START_SUC","AUD_START_FAIL","AUD_STOP_SUC","AUD_STOP_FAIL","AUD_DATA","SS_DATA","MOV_DATA","PEN_START_SUC","PEN_START_FAIL","PEN_STOP_SUC","PEN_STOP_FAIL","PEN_VERSION","QAV_DEVICE_SUC","QAV_DEVICE_FAIL","CBD_QUERY_SUC","CBD_QUERY_FAIL","CBD_GET_SUC","CBD_GET_FAIL","FILE_GET_SUC","FILE_GET_FAIL","FILE_SET_SUC","FILE_SET_FAIL","RESTART_SUC","RESTART_FAIL","GET_CAM_SUC","GET_CAM_FAIL","CAM_START_SUC","CAM_START_FAIL","CAM_STOP_SUC","CAM_STOP_FAIL","SWITCH_SCENE_SUC","SWITCH_SCENE_FAIL","PUSH_STREAM_FAIL","SHOW_UI_SUC","SET_VIDEO_PARAM_SUC","SET_VIDEO_PARAM_FAIL","GET_VIDEO_PARAM_SUC","GET_VIDEO_PARAM_FAIL","START_RECORD_SUC","START_RECORD_FAIL","STOP_RECORD_SUC","STOP_RECORD_FAIL","START_PUSH_SUC","START_PUSH_FAIL","STOP_PUSH_SUC","STOP_PUSH_FAIL","GET_RTMP_PORT_SUC","GET_RTMP_PORT_FAIL","SET_MIC_VOL_SUC","SET_MIC_VOL_FAIL","GET_MIC_VOL_SUC","GET_MIC_VOL_FAIL","RTMP_CONNECTING","RTMP_CONNECT_SUC","RTMP_CONNECT_FAIL","RTMP_CONNECT_CLOSED"],C=null,O="",u=[],T=[],I="",U="",d="",R=null,g="127.0.0.1",p=8090,L=0;f.infos={movieInfo:C,versionInfo:O,cameraInfo:u,micInfo:T,videoInfo:I,rtmpPort:U,micVol:d},f.MOVIE_INFO_CHANGE="MOVIE_INFO_CHANGE",f.VERSION_INFO_CHANGE="VERSION_INFO_CHANGE",f.CAMERA_INFO_CHANGE="CAMERA_INFO_CHANGE",f.MIC_INFO_CHANGE="MIC_INFO_CHANGE",f.VIDEO_INFO_CHANGE="VIDEO_INFO_CHANGE",f.RTMP_PORT_CHANGE="RTMP_PORT_CHANGE",f.MIC_VOL_CHANGE="MIC_VOL_CHANGE",f.SS_START="SS_START",f.SS_STOP="SS_STOP",f.OPEN="OPEN",f.CLOSE="CLOSE",f.ERROR="ERROR",f.getRTMPPort=function(){o("get_rtmp_port")},f.getMicInfo=function(){o("get_mic")},f.getCamInfo=function(){o("get_cam")},f.getMicVol=function(){o("get_mic_vol")},f.start=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"127.0.0.1",t=arguments[1];g=e,p=t,S()},f.stop=function(){s()},f.startShareScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o("ss_start",e)},f.stopShareScreen=function(){o("ss_stop")},t.default=f},function(e,t,_){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(){console.log("发起屏幕"),i.default.startShareScreen("rtmp://123.56.205.116/live/alexwang")}function r(){console.log("关闭屏幕"),i.default.stopShareScreen()}var o=_(2),i=n(o);i.default.on(i.default.SS_START,function(){console.log("SS_START"),setTimeout(function(){r()},200)}),i.default.on(i.default.SS_STOP,function(){console.log("SS_STOP"),setTimeout(function(){a()},500)}),i.default.on(i.default.ERROR,function(){console.log("ERROR")}),i.default.on(i.default.CLOSE,function(){console.log("CLOSE")}),i.default.on(i.default.OPEN,function(){console.log("OPEN"),a()}),i.default.start("192.168.222.216",8090)}])});
\ No newline at end of file
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.share=t():e.share=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){!function(){throw new Error('Cannot find module "./test.js"')}()}])});
\ No newline at end of file
... ...
... ... @@ -21,8 +21,8 @@
"wbp": {
"project": "umd",
"entries": {
"main": "./src/main.js",
"test": "./test/test.js"
"screenShare": "./main.js",
"test": "./test.js"
},
"source": "src/",
"build": "dist/"
... ...
... ... @@ -389,6 +389,7 @@ let micVol = '';
let ws = null;
let host = '127.0.0.1';
let port = 8090;
let fullUrl='ws://127.0.0.1:8090'
let wstimer = 0;
function clear() {
... ... @@ -411,7 +412,8 @@ function start() {
if (ws) {
clear();
}
ws = new WebSocket('ws://' + host + ':' + port);
//ws = new WebSocket('ws://' + host + ':' + port);
ws = new WebSocket(fullUrl);//wss或ws地址 由外部传递
wstimer = setTimeout(() => {
clearTimeout(wstimer);
clear();
... ... @@ -584,6 +586,11 @@ e.start = (_host = '127.0.0.1', _port) => {
port = _port;
start();
}
e.startConnect = (_fullUrl) => {
fullUrl=_fullUrl;
start();
}
e.stop = () => {
stop();
}
... ...
... ... @@ -80,4 +80,4 @@ ss.on(ss.OPEN, () => {
})
// 连接本地流媒体服务
ss.start('192.168.222.216', 8090);
ss.start('127.0.0.1', 8090);
... ...