Skip to content

Commit

Permalink
Merge pull request #419 from samvera-labs/sticky-mute-fix
Browse files Browse the repository at this point in the history
Fix sticky mute when switching from video to audio in mobile
  • Loading branch information
Dananji authored Feb 15, 2024
2 parents 2a19ca0 + bb34ad9 commit 2f31fb4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/MediaPlayer/VideoJS/VideoJSPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ function VideoJSPlayer({
player.on('ready', function () {
console.log('Player ready');

// Add class for volume panel in audio player to make it always visible
if (!isVideo) {
/*
Add class to the volume panel in audio player to make it always visible.
This is only applicable in non-mobile devices as mobile devices only
have the mute toggle.
*/
if (!isVideo && !IS_MOBILE) {
player.getChild('controlBar').getChild('VolumePanel').addClass('vjs-slider-active');
}
// Add this class in mobile/tablet devices to always show the control bar,
Expand Down Expand Up @@ -589,16 +593,16 @@ function VideoJSPlayer({

// Classes for setting caption size based on device
let videoClass = '';
if (IS_ANDROID) {
if (IS_ANDROID) {
videoClass = "video-js vjs-big-play-centered android";
// Not all Android tablets return 'Android' in the useragent so assume non-android,
// non-iOS touch devices are tablets.
// Not all Android tablets return 'Android' in the useragent so assume non-android,
// non-iOS touch devices are tablets.
} else if (IS_TOUCH_ONLY && !IS_IOS) {
videoClass = "video-js vjs-big-play-centered tablet";
} else if (IS_IPAD) {
videoClass = "video-js vjs-big-play-centered tablet";
} else {
videoClass = "video-js vjs-big-play-centered";
} else {
videoClass = "video-js vjs-big-play-centered";
};

return (
Expand Down

0 comments on commit 2f31fb4

Please sign in to comment.