I want to disable Picture in Picture feature for <Video>
tag for my website due to some certification requirements but firefox does not allow to turn off. Any help would be appreciated.
shadow-root
with {mode:"closed"}
to forcefully display Picture in Picture toogle (See the image).Note: I have also added disablePictureInPicture
attribute but still it's not working for firefox.
<video width="400" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls disablePictureInPicture></video>
You’ll see “ Enable picture-in-picture video controls ” option. The option is enabled by default i.e. Picture-In-Picture feature is activated in Firefox. Uncheck the option to deactivate and disable Picture-In-Picture feature. Now you’ll no longer see Picture-In-Picture icon while playing a video on any web page.
To delete an image in JavaScript (or generally to delete anything), first you should grab the element, then traverse to its parent element, then you can delete the child using removeChild method. when you want to show the image.
If you hover mouse cursor over the icon, it’ll convert into a big blue icon showing “ Picture-in-Picture ” text as shown in following screenshot: Click on the “Picture-in-Picture” icon and Firefox will launch or detach the video in a separate floating window which contains a big “Close” button.
To delete an image in JavaScript (or generally to delete anything), first you should grab the element, then traverse to its parent element, then you can delete the child using removeChild method. Show activity on this post. when you want to show the image. Show activity on this post.
Videos without audio do not have the picture in picture button in firefox. This will not work for all use cases, but it might be useful in some situations. If you really depend on it and having audio you could try using a separate audio tag, but that could result in desynchronization issues.
You can do this e.g. using ffmpeg like described in this question.
As far as I know, there is currently (as of Firefox 72) no option for website authors to disable the button. Only users can hide it via the Firefox settings.
Though a request to add an API was created just a few hours ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With