Picture in Picture (PiP) present but without functionality in audio mode
Description
Picture in Picture (PiP) function active but not working when videojs is used as a music player via <audio></audio> element.
Steps to reproduce
- Use videojs as a music player via
<audio></audio> and type="audio/mpeg"HTML code - Play your music and click on the player control bar PiP function
- Nothing happens
Results
Expected
PiP is of course much more powerful in use of a video but it should be great to be able to use the player as a master on the screen even in music mode even if only a poster is present the player control bar (pause and play) will be easier to operate. If PiP also could include volume functions it should be fantastic.
Actual
Nothing happens = Icon present on player control bar without functionality.
Error output
video.min.js:12 VIDEOJS: ERROR: TypeError: this.el_.requestPictureInPicture is not a function at o.e.requestPictureInPicture (video.min.js:19) at l.e.techGet_ (video.min.js:19) at l.e.requestPictureInPicture (video.min.js:19) at e.t.handleClick (video.min.js:19) at HTMLButtonElement.o.dispatcher.o.dispatcher (video.min.js:12) (anonymous) @ video.min.js:12 n.error @ video.min.js:12 o.dispatcher.o.dispatcher @ video.min.js:12
Additional Information
N/A
versions
videojs
v7.7.4
browsers
Google Chrome Version 79.0.3945.88 (Official Build) (64-bit)
OSes
Windows 10 v1909 64-bit
plugins
silvermine-videojs-airplay silvermine-videojs-chromecast
I wonder if the audio element isn't available for PiP. PiP is using native browser functionality to load the video into a separate window thing and because audio doesn't have a rendering area, PiP probably doesn't work. We probably want to disable/hide the PiP button if an audio element is being used.
Sounds realistic but at the same time sad since the function should be powerful in audio mode as well. I also found out if I try to activate PiP in audio mode VideoJS play/pause control bar function stop work until I reload the page with a refresh command.
During the meantime I disable the PiP control bar function as you suggest in an earlier discussion...
options = {
controlBar: {
pictureInPictureToggle: false
}
};
Could this be something to add along with #6378
Chrome rejects requestPictureInPicture on a video element if there's no video track so we'd need to test for that too. There's probably no way to make PIP work with audio now, but there is Media Session.
When I try to use PiP via videoJS and YouTube plugin the PiP function is active in control bar but without functionality. Error code... video.min.js:19 Uncaught (in promise) undefined e.requestPictureInPicture @ video.min.js:19 e.techGet_ @ video.min.js:19 e.requestPictureInPicture @ video.min.js:19 t.handleClick @ video.min.js:19 o.dispatcher.o.dispatcher @ video.min.js:12 Example: https://codepen.io/DJ-PD/full/bGNwQYe
Still receive warnings and it's not work good when it comes to YouTube sources even after an VideoJS update to v.7.7.5. Are we facing compatibility issues? See also #6358 describing more in details... https://github.com/videojs/video.js/issues/6358#issuecomment-599047200
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still receive warnings and it's not work good when it comes to YouTube sources. Are we facing compatibility issues? See also #6358 describing more in details... #6358 (comment)