|
896 | 896 | } |
897 | 897 | } else if (!!this.jSPlugin) { |
898 | 898 | var _this = this; |
899 | | - function getPlayParams(url) { |
| 899 | + // 默认开启第一路声音 |
| 900 | + setTimeout(function(){ |
| 901 | + _this.log("默认开启第一路声音") |
900 | 902 | _this.jSPlugin.JS_OpenSound(0); |
901 | | - // _this.jSPlugin.JS_SetVolume(0,100); |
| 903 | + },5000) |
| 904 | + function getPlayParams(url) { |
902 | 905 | var websocketConnectUrl = url.split('?')[0].replace('/live', '').replace('/playback', ''); |
903 | 906 | var websocketStreamingParam = (url.indexOf('/live')=== -1 ? '/playback?': '/live?') + url.split('?')[1]; |
904 | 907 | return { websocketConnectUrl: websocketConnectUrl, websocketStreamingParam: websocketStreamingParam } |
905 | 908 | } |
906 | 909 | if (!params || typeof params.index === 'undefined') { |
907 | 910 | _this.opt.sources.forEach(function (item, index) { |
908 | | - console.log("ready realplay") |
909 | 911 | _this.jSPlugin.JS_Play(getPlayParams(item).websocketConnectUrl, { playURL: getPlayParams(item).websocketStreamingParam }, index).then(function () { |
910 | 912 | console.log("realplay success"); |
911 | 913 | if (params && params.handleSuccess) { |
912 | 914 | params.handleSuccess(); |
913 | | - // 默认开启声音 |
914 | | - _this.jSPlugin.JS_OpenSound(0); |
915 | | - // _this.jSPlugin.JS_SetVolume(0,100); |
916 | 915 | } |
917 | 916 | }, function (err) { |
918 | 917 | console.log("realplay failed", err.oError); |
|
1090 | 1089 | } |
1091 | 1090 | } |
1092 | 1091 | }; |
| 1092 | + // 获取OSD时间 |
1093 | 1093 | EZUIPlayer.prototype.getOSDTime = function(callback,iWind){ |
1094 | 1094 | if (!!this.jSPlugin){ |
1095 | 1095 | this.jSPlugin.JS_GetOSDTime(iWind || 0).then(function(iTime){ |
|
1101 | 1101 | throw new Error("Method not support"); |
1102 | 1102 | } |
1103 | 1103 | } |
| 1104 | + // 开启声音 |
| 1105 | + EZUIPlayer.prototype.openSound = function(iWind){ |
| 1106 | + if (!!this.jSPlugin){ |
| 1107 | + this.jSPlugin.JS_OpenSound(iWind || 0) |
| 1108 | + }else { |
| 1109 | + throw new Error("Method not support"); |
| 1110 | + } |
| 1111 | + } |
1104 | 1112 | EZUIPlayer.prototype.pause = function () { |
1105 | 1113 | this.opt.autoplay = false; |
1106 | 1114 | if (!!window['CKobject']) { |
|
0 commit comments