@@ -1571,7 +1571,14 @@ function addCss(filepath, callback) {
15711571 _this . log ( "默认开启第1路声音" ) ;
15721572 setTimeout ( function ( ) {
15731573 var openSoundRT = _this . openSound ( 0 ) ;
1574- if ( openSoundRT == 0 ) {
1574+ if ( isPromise ( openSoundRT ) ) {
1575+ openSoundRT . then ( function ( ) {
1576+ _this . log ( '开启声音成功' ) ;
1577+ } )
1578+ . catch ( function ( err ) {
1579+ _this . log ( '开启声音失败' , 'error' ) ;
1580+ } )
1581+ } else if ( openSoundRT == 0 ) {
15751582 _this . log ( '开启声音成功' , data )
15761583 } else {
15771584 _this . log ( '开启声音失败' , 'error' )
@@ -1673,6 +1680,9 @@ function addCss(filepath, callback) {
16731680 // DOM id
16741681 function initDecoder ( resolve , reject ) {
16751682 var jsPluginPath = playParams . decoderPath + '/js/jsPlugin-1.2.0.min.js' ;
1683+ if ( playParams . decoderVersion ) {
1684+ var jsPluginPath = playParams . decoderPath + '/js/versions/' + playParams . decoderVersion + '/jsPlugin-1.2.0.min.js' ;
1685+ }
16761686 document . getElementById ( playParams . id ) . style . width = ( playParams . width || 600 ) + 'px' ;
16771687 document . getElementById ( playParams . id ) . style . height = ( playParams . height || 400 ) + 'px' ;
16781688 /** 初始化解码器 */
@@ -1687,7 +1697,7 @@ function addCss(filepath, callback) {
16871697 iHeight : playParams . height || 400 ,
16881698 iMaxSplit : Math . ceil ( Math . sqrt ( playParams . url . split ( "," ) . length ) ) ,
16891699 iCurrentSplit : playParams . splitBasis || Math . ceil ( Math . sqrt ( playParams . url . split ( "," ) . length ) ) ,
1690- szBasePath : playParams . decoderPath + '/js' ,
1700+ szBasePath : playParams . decoderVersion ? ( playParams . decoderPath + '/js/versions/' + playParams . decoderVersion ) : ( playParams . decoderPath + '/js' ) ,
16911701 oStyle : {
16921702 border : "none" ,
16931703 background : "#000000"
@@ -1967,7 +1977,17 @@ function addCss(filepath, callback) {
19671977 EZUIPlayer . prototype . openSound = function ( iWind ) {
19681978 if ( ! ! this . jSPlugin ) {
19691979 var openSoundRT = this . jSPlugin . JS_OpenSound ( iWind || 0 ) ;
1970- if ( openSoundRT === 0 ) {
1980+ if ( isPromise ( openSoundRT ) ) {
1981+ openSoundRT . then ( function ( ) {
1982+ this . log ( '开启声音成功' ) ;
1983+ if ( this . playControls ) {
1984+ this . playControls . setVoiceStatus ( 1 )
1985+ }
1986+ } )
1987+ . catch ( function ( err ) {
1988+ this . log ( '开启声音失败' , 'error' ) ;
1989+ } )
1990+ } else if ( openSoundRT === 0 ) {
19711991 this . log ( '开启声音成功' ) ;
19721992 if ( this . playControls ) {
19731993 this . playControls . setVoiceStatus ( 1 )
@@ -1992,9 +2012,19 @@ function addCss(filepath, callback) {
19922012 EZUIPlayer . prototype . closeSound = function ( iWind ) {
19932013 if ( ! ! this . jSPlugin ) {
19942014 var closeSoundRT = this . jSPlugin . JS_CloseSound ( iWind || 0 ) ;
1995- if ( closeSoundRT === 0 ) {
1996- this . log ( '关闭声音成功' )
1997- if ( this . playControls ) {
2015+ if ( isPromise ( closeSoundRT ) ) {
2016+ closeSoundRT . then ( function ( ) {
2017+ this . log ( '关闭声音成功' ) ;
2018+ if ( this . playControls ) {
2019+ this . playControls . setVoiceStatus ( 0 )
2020+ }
2021+ } )
2022+ . catch ( function ( err ) {
2023+ this . log ( '关闭声音失败' , 'error' ) ;
2024+ } )
2025+ } else if ( closeSoundRT === 0 ) {
2026+ this . log ( '关闭声音成功' ) ;
2027+ if ( this . playControls ) {
19982028 this . playControls . setVoiceStatus ( 0 )
19992029 }
20002030 } else {
0 commit comments