From 0a858b56c72ca331e51753cdc4d0af783f271bb4 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Thu, 29 Sep 2011 15:27:50 +0200 Subject: [PATCH] fixes to the mute and volume functions --- players/jwplayer/popcorn.jwplayer.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/players/jwplayer/popcorn.jwplayer.js b/players/jwplayer/popcorn.jwplayer.js index 0c87c12..00ba15e 100644 --- a/players/jwplayer/popcorn.jwplayer.js +++ b/players/jwplayer/popcorn.jwplayer.js @@ -59,15 +59,17 @@ Popcorn.player( "jwplayer", { Popcorn.player.defineProperty( media, "muted", { set: function( val ) { - if ( jwplayer( container.id ).getMute() !== val ) { - if ( val ) { - jwplayer( container.id ).setMute(true); + if ( jwplayer( container.id ).getMute() !== val ) { + if ( val ) { + jwplayer( container.id ).setMute(true); + } else { + jwplayer( container.id ).setMute(false); + } + + media.dispatchEvent( "volumechange" ); } - - media.dispatchEvent( "volumechange" ); - } - - return jwplayer( container.id ).getMute(); + + return jwplayer( container.id ).getMute(); }, get: function() { return jwplayer( container.id ).getMute(); @@ -79,15 +81,15 @@ Popcorn.player( "jwplayer", { set: function( val ) { if ( jwplayer( container.id ).getVolume() !== val *100 ) { - jwplayer( container.id ).setVolume( val * 100); - media.dispatchEvent( "volumechange" ); + jwplayer( container.id ).setVolume( val * 100); + media.dispatchEvent( "volumechange" ); } - + return (jwplayer( container.id ).getVolume()) / 100; }, get: function() { - return jwplayer( container.id ).percentage / 100; + return jwplayer( container.id ).getVolume() / 100; } }); -- 2.43.0