Skip to content

Mute/unmute volume control should show on iOS #4478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rudyzeinoun opened this issue Jul 10, 2017 · 14 comments
Closed

Mute/unmute volume control should show on iOS #4478

rudyzeinoun opened this issue Jul 10, 2017 · 14 comments

Comments

@rudyzeinoun
Copy link

rudyzeinoun commented Jul 10, 2017

On iOS, the volume bar is hidden because we cannot control the volume due to an OS restriction. However, the mute/unmute button should still show. This is useful in cases where "autoplay muted playsinline" is used, so the video starts automatically playing, but there would be no way to unmute it, even from the device's hardware volume controls or the OS volume slider.

You can force the controls to display by CSS, by adding:

.video-js .vjs-volume-panel { display: flex !important }
.video-js .vjs-mute-control { display: inline-block !important }

Which allows unmuting the video, but the experience is not optimal and the volume slider still takes some space until it times out and closes back. This can be fixed by more CSS changes, but these are dirty workarounds.

The expected result is to show the volume icon on iOS to allow mute/unmute.

@arashilan
Copy link

arashilan commented Jul 12, 2017

Excuse me, how can video autoplay on iOS?
When set "autoplay muted" in <video>,then the video can autoplay.
When set "autoplay" in <video>,then can't autoplay.

Use video.js in html5 .

@rudyzeinoun
Copy link
Author

rudyzeinoun commented Jul 12, 2017

If you're on iOS, the volume mute/unmute button (in VideoJS's skin) is hidden, because iOS doesn't let you control volume using JavaScript.
So if you have autoplay muted, there's no way for the user to unmute.

@misteroneill
Copy link
Member

We are currently planning a sweep related to the autoplay/muted/playsinline complexity this quarter. Stay tuned!

Excuse me, how can video autoplay on iOS?
When set "autoplay muted" in

Yes, that is the behavior of iOS Safari and Android Chrome. You cannot autoplay non-muted video on those platforms. Safari 11 on macOS will behave the same way.

@rudyzeinoun
Copy link
Author

I would advise having an always-showing unmute button when this mode is on, similar to how Facebook does it.

@misteroneill
Copy link
Member

This looks like a duplicate of #4373

@potsky
Copy link

potsky commented Oct 3, 2017

Agree with @rudyzeinoun, on iOS, the autoplay/muted/playsinline works but I need to use a ugly settimout to remove vis-hidden class from volume panel the mute button.

nathanallen pushed a commit to doximity/video.js that referenced this issue Feb 14, 2018

Verified

This commit was signed with the committer’s verified signature.
renovate-bot Mend Renovate
nathanallen added a commit to doximity/video.js that referenced this issue Feb 14, 2018
@cmellinas
Copy link

Hi,
any updates on this issue?
thanks

@FuminoriSugawara
Copy link

Hi,
I tried to show volume control button.
This code worked on iOS 11 with video.js v6.8.0.
I hope I can be of any help.
Thanks.

<video id="video_player" class="video-js vjs-default-skin" controls preload playsinline muted>
    <source src="/path/to/video" type="application/x-mpegURL">
</video>
/* ... */
<script>
var player = videojs('video_player');
player.ready(function() {
    player.on('play', function() {
            player.controlBar.volumePanel.show();
            player.controlBar.volumePanel.volumeControl.show();
            player.controlBar.volumePanel.muteToggle.show();
    });
});
</script>

@gkatsev
Copy link
Member

gkatsev commented May 4, 2018

There's a PR for this being worked on by @bcdarius: #5052.

@prozak915
Copy link

Jtel to edit them on phone ?

@gkatsev
Copy link
Member

gkatsev commented Jun 21, 2018

This should be fixed in master now, a release of 7 is coming soon and it'll be back ported to 6.x at some point as well.

gkatsev pushed a commit that referenced this issue Jul 9, 2018
Currently, VideoJS combines volume control with muted support, and these actions aren't actually the same. Muting/unmuting volume work independently from the volume control. For example, iOS doesn't support controlling volume programmatically but allows muting/unmuting volume.

This change will display the volume control panel and mute toggle button if the tech supports muting volume. The volume slider will continue to be hidden if the platform doesn't allow programmatically control volume. If neither muting nor control volume is supported, volume panel will not be displayed.

Fixes #4478.
@MrWiLofDoom
Copy link

Is this fixed in 7? I am running 7 and I'm still not seeing the mute button

@bcdarius
Copy link
Contributor

The mute toggle button is displayed on iOS in v7.1.0+. Is that the version you're testing on? I'm seeing the mute toggle button fine here https://output.jsbin.com/sovubus. Another thing to note is that the mute control will be visible in iOS versions that supports muting volume programmatically only, ie iOS 10+.

@simeyla
Copy link

simeyla commented May 27, 2020

I'd love to see a bigUnmuteButton analogous to bigPlayButton

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests