@@ -608,7 +608,9 @@ this.createjs = this.createjs || {};
608608 * @default 1
609609 */
610610 p . _volume = 1 ;
611- Object . defineProperty ( p , "volume" , {
611+ // IE8 has Object.defineProperty, but only for DOM objects, so check if fails to suppress errors
612+ try {
613+ Object . defineProperty ( p , "volume" , {
612614 get : function ( ) {
613615 return this . _volume ;
614616 } ,
@@ -618,7 +620,10 @@ this.createjs = this.createjs || {};
618620 this . _volume = value ;
619621 this . updateVolume ( ) ;
620622 }
621- } ) ;
623+ } ) ;
624+ } catch ( e ) {
625+ // dispatch message or error?
626+ } ;
622627
623628 /**
624629 * The pan of the sound, between -1 (left) and 1 (right). Note that pan does not work for HTML Audio.
@@ -631,21 +636,27 @@ this.createjs = this.createjs || {};
631636 * @default 0
632637 */
633638 p . _pan = 0 ;
634- Object . defineProperty ( p , "pan" , {
635- get : function ( ) {
636- return this . _pan ;
637- } ,
638- set : function ( value ) {
639- if ( ! this . owner . capabilities . panning || Number ( value ) == null ) { return false ; }
639+ // IE8 has Object.defineProperty, but only for DOM objects, so check if fails to suppress errors
640+ try {
641+ Object . defineProperty ( p , "pan" , {
642+ get : function ( ) {
643+ return this . _pan ;
644+ } ,
645+ set : function ( value ) {
646+ if ( ! this . owner . capabilities . panning || Number ( value ) == null ) { return false ; }
647+
648+ value = Math . max ( - 1 , Math . min ( 1 , value ) ) ; // force pan to stay in the -1 to 1 range
649+ // Note that panning in WebAudioPlugin can support 3D audio, but our implementation does not.
650+ this . _pan = value ; // Unfortunately panner does not give us a way to access this after it is set http://www.w3.org/TR/webaudio/#AudioPannerNode
651+ this . panNode . setPosition ( value , 0 , - 0.5 ) ; // z need to be -0.5 otherwise the sound only plays in left, right, or center
652+ }
653+ } ) ;
654+ } catch ( e ) {
655+ // dispatch message or error?
656+ } ;
640657
641- value = Math . max ( - 1 , Math . min ( 1 , value ) ) ; // force pan to stay in the -1 to 1 range
642- // Note that panning in WebAudioPlugin can support 3D audio, but our implementation does not.
643- this . _pan = value ; // Unfortunately panner does not give us a way to access this after it is set http://www.w3.org/TR/webaudio/#AudioPannerNode
644- this . panNode . setPosition ( value , 0 , - 0.5 ) ; // z need to be -0.5 otherwise the sound only plays in left, right, or center
645- }
646- } ) ;
647658
648- /**
659+ /**
649660 * The length of the audio clip, in milliseconds.
650661 * Use {{#crossLink "SoundInstance/getDuration:method"}}{{/crossLink}} to access.
651662 * @property pan
0 commit comments