File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ shaka.extern.UIQualityMarks;
137
137
* showAudioCodec: boolean,
138
138
* showVideoCodec: boolean,
139
139
* castSenderUrl: string,
140
- * enableKeyboardPlaybackControlsInWindow: boolean
140
+ * enableKeyboardPlaybackControlsInWindow: boolean,
141
+ * alwaysShowVolumeBar: boolean
141
142
* }}
142
143
*
143
144
* @property {!Array<string> } controlPanelElements
@@ -374,6 +375,11 @@ shaka.extern.UIQualityMarks;
374
375
* <code>enableKeyboardPlaybackControls</code> is true.
375
376
* <br>
376
377
* Defaults to <code>false</code>.
378
+ * @property {boolean } alwaysShowVolumeBar
379
+ * Always show the volume bar, even when the volume and mute bars are next to
380
+ * each other.
381
+ * <br>
382
+ * Defaults to <code>false</code>.
377
383
* @exportDoc
378
384
*/
379
385
shaka . extern . UIConfiguration ;
Original file line number Diff line number Diff line change 164
164
}
165
165
}
166
166
167
- .shaka-mute-button :hover + .shaka-volume-bar-container {
167
+ .shaka-mute-button :hover + .shaka-volume-bar-container-allow-hiding {
168
168
width : 50px ;
169
169
opacity : 1 ;
170
170
}
171
171
}
172
172
173
- .shaka-mute-button + .shaka-volume-bar-container :not (:focus-within ) {
173
+ /* stylelint-disable-next-line max-line-length */
174
+ .shaka-mute-button + .shaka-volume-bar-container-allow-hiding :not (:focus-within ) {
174
175
width : 0 ;
175
176
opacity : 0 ;
176
177
}
177
178
178
179
@media (min-width : 475px ) {
179
- .shaka-mute-button :hover + .shaka-volume-bar-container {
180
+ .shaka-mute-button :hover + .shaka-volume-bar-container-allow-hiding {
180
181
width : 100px ;
181
182
opacity : 1 ;
182
183
}
Original file line number Diff line number Diff line change @@ -379,6 +379,7 @@ shaka.ui.Overlay = class {
379
379
showVideoCodec : true ,
380
380
castSenderUrl : 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js' ,
381
381
enableKeyboardPlaybackControlsInWindow : false ,
382
+ alwaysShowVolumeBar : false ,
382
383
} ;
383
384
384
385
// On mobile, by default, hide the volume slide and the small play/pause
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
33
33
/** @private {!shaka.extern.UIConfiguration} */
34
34
this . config_ = this . controls . getConfig ( ) ;
35
35
36
+ if ( ! this . config_ . alwaysShowVolumeBar ) {
37
+ this . container . classList . add ( 'shaka-volume-bar-container-allow-hiding' ) ;
38
+ }
39
+
36
40
// We use a range of 100 to avoid problems with Firefox.
37
41
// See https://github.com/shaka-project/shaka-player/issues/3987
38
42
this . setRange ( 0 , 100 ) ;
You can’t perform that action at this time.
0 commit comments