video.js icon indicating copy to clipboard operation
video.js copied to clipboard

Picture in Picture (PiP) present but without functionality in audio mode

Open DJ-PD opened this issue 6 years ago • 7 comments

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

  1. Use videojs as a music player via <audio></audio> and type="audio/mpeg" HTML code
  2. Play your music and click on the player control bar PiP function
  3. 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

DJ-PD avatar Jan 12 '20 12:01 DJ-PD

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.

gkatsev avatar Jan 13 '20 19:01 gkatsev

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

DJ-PD avatar Jan 19 '20 13:01 DJ-PD

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.

mister-ben avatar Jan 22 '20 19:01 mister-ben

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

DJ-PD avatar Jan 26 '20 14:01 DJ-PD

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

DJ-PD avatar Mar 14 '20 12:03 DJ-PD

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.

stale[bot] avatar May 13 '20 12:05 stale[bot]

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)

DJ-PD avatar May 14 '20 07:05 DJ-PD