21 this.selector.children(".Ldt-controler").show(); |
21 this.selector.children(".Ldt-controler").show(); |
22 |
22 |
23 // handle clicks by the user on the video. |
23 // handle clicks by the user on the video. |
24 this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater)); |
24 this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater)); |
25 this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater)); |
25 this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater)); |
|
26 |
|
27 this._Popcorn.listen("volumechange", IriSP.wrap(this, this.muteButtonUpdater)); |
26 |
28 |
27 this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater)); |
29 this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater)); |
28 this._Popcorn.listen("IriSP.search.matchFound", IriSP.wrap(this, this.searchMatch)); |
30 this._Popcorn.listen("IriSP.search.matchFound", IriSP.wrap(this, this.searchMatch)); |
29 this._Popcorn.listen("IriSP.search.noMatchFound", IriSP.wrap(this, this.searchNoMatch)); |
31 this._Popcorn.listen("IriSP.search.noMatchFound", IriSP.wrap(this, this.searchNoMatch)); |
30 |
32 |
108 }; |
110 }; |
109 |
111 |
110 IriSP.PlayerWidget.prototype.muteHandler = function() { |
112 IriSP.PlayerWidget.prototype.muteHandler = function() { |
111 if (!this._Popcorn.muted()) { |
113 if (!this._Popcorn.muted()) { |
112 this._Popcorn.mute(true); |
114 this._Popcorn.mute(true); |
113 this.selector.find(" .ui-icon-volume-on ").css("background-position", "-130px -160px"); |
|
114 } else { |
115 } else { |
115 this._Popcorn.mute(false); |
116 this._Popcorn.mute(false); |
116 this.selector.find( ".ui-icon-volume-on" ).css("background-position", "-144px -160px" ); |
|
117 } |
117 } |
118 }; |
118 }; |
|
119 |
|
120 IriSP.PlayerWidget.prototype.muteButtonUpdater = function() { |
|
121 var status = this._Popcorn.media.muted; |
|
122 |
|
123 if ( status == true ){ |
|
124 this.selector.find(".Ldt-CtrlSound").attr("title", "Unmute"); |
|
125 |
|
126 // we use templToHTML because it has some predefined |
|
127 // vars like where to get the images |
|
128 var templ = IriSP.templToHTML("url({{img_dir}}/sound_sprite.png)"); |
|
129 this.selector.find(".Ldt-CtrlSound").css("background-image", templ); |
|
130 |
|
131 } else { |
|
132 this.selector.find(".Ldt-CtrlSound").attr("title", "Mute"); |
|
133 |
|
134 // we use templToHTML because it has some predefined |
|
135 // vars like where to get the images |
|
136 var templ = IriSP.templToHTML("url({{img_dir}}/mute_sprite.png)"); |
|
137 this.selector.find(".Ldt-CtrlSound").css("background-image", templ); |
|
138 } |
|
139 |
|
140 return; |
|
141 }; |
|
142 |
119 |
143 |
120 IriSP.PlayerWidget.prototype.searchButtonHandler = function() { |
144 IriSP.PlayerWidget.prototype.searchButtonHandler = function() { |
121 var self = this; |
145 var self = this; |
122 |
146 |
123 /* show the search field if it is not shown */ |
147 /* show the search field if it is not shown */ |