Closed Bug 2043822 Opened 6 months ago Closed 1 month ago

music.youtube.com - Picture-in-Picture is not kept when the next song autoplays

Categories

(Toolkit :: Picture-in-Picture, defect)

Firefox 151
Desktop
Windows 10
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: denyshon, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [webcompat-source:web-bugs][webcompat:sightline][webcompat:japan])

Steps to reproduce:

  1. Start listening to any song on https://music.youtube.com/
  2. Make sure autoplay is enabled.
  3. While the song is running, activate Picture-in-Picture by clicking the corresponding icon, or switch tabs if "Keep playing videos in Picture-in-Picture when switching tabs" is enabled.
  4. Wait until the song ends (you can use the slider to skip most of it).
  5. Keep PiP when the next song starts.

Expected Behavior:
The next song runs in PiP.

Actual Behavior:
PiP is deactivated, and the next song runs as usual.

See Also: → 1696799

Hey Denys, thanks for the bug report. I'm not able to reproduce this on a playlist with music videos. Do you recall if a music video or just audio was autoplayed when you saw the issue?

On another note, skipping a big part of a music video closes the PiP window. I'm curious if that's related to the problem. Tried verifying this in DevTools and found that MozStopPictureInPicture is dispatched and closePictureInPictureIfDisconnected gets called https://searchfox.org/firefox-main/rev/580c73c8203a53a1f348727e0941f24439416e95/toolkit/actors/PictureInPictureChild.sys.mjs#2029,2034. A script is removing the video element and triggering UnbindFromTree, which dispatches MozStopPictureInPicture.

Flags: needinfo?(denyshon)

Hi! Thank you so much for looking into. This used to reproduce with both; however, currently I see something different:

  • With music videos, it works as expected.
  • With audio, Firefox now fails to open PiP at all (this wasn't the case before).

Should I file a bug for the second part? Or is that something we don't want to track?

Flags: needinfo?(denyshon) → needinfo?(kpatenio)

(In reply to Denys [:denyshon] from comment #2)

Hi! Thank you so much for looking into. This used to reproduce with both; however, currently I see something different:

  • With music videos, it works as expected.
  • With audio, Firefox now fails to open PiP at all (this wasn't the case before).

Should I file a bug for the second part? Or is that something we don't want to track?

Hi Denys, thanks for the update. Glad to hear PiP now works with music videos.

Regarding audio: to clarify, do you see the PiP toggle on the page but it fails to activate? Or is it simply not visible for use? If you could also share with us a link that reproduces the issue, that would be greatly appreciated. Any information would help us narrow down what's going wrong.

For what it's worth, the PiP toggle not being visible for audio-only tracks sounds like expected behaviour. Debugging this link for example, the page only shows a static album image. Because there's no actual video, it doesn't meet the requirements PiP checks for, such as minimum video size and duration. (The list of requirements can be read here and here).

Flags: needinfo?(kpatenio) → needinfo?(denyshon)

Hi Denys, considering it's been a while since we heard from you, I'm going to this bug as INCOMPLETE. If there's any info you can provide to clarify how PiP behaves for audio-only content in YouTube Music, please let us know and feel free to re-open the ticket. For what it's worth, your bug report helped me find a different issue reproducible in YouTube Music; I've filed the issue separately in Bug 2079949.

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE

Hi! Sorry for such a long delay. I guess my initial STR no longer reproduce; however, I'm puzzled about the following behavior:

When a video is followed by a track without video content in a queue, and PiP is already open, it is kept for the track without video (showing just a black rectangle with controls). However, if I just start playing a pure audio track (without having PiP open) and then switch tabs, PiP doesn't open.

To be honest, I'd advocate for opening PiP for audio too, not only video, but I suspect that the intended behavior may be the opposite. Let me know if I should file a bug for either of these (but I still very much want PiP to handle audio too, at least as-is for now until we can build a special UI for this case).

Given that the initial STR no longer reproduce, I'll change the bug resolution to WFM.

Flags: needinfo?(denyshon) → needinfo?(kpatenio)
Resolution: INCOMPLETE → WORKSFORME
See Also: → 1622991
See Also: → 2088641

Thanks for the update.

When a video is followed by a track without video content in a queue, and PiP is already open, it is kept for the track without video (showing just a black rectangle with controls). However, if I just start playing a pure audio track (without having PiP open) and then switch tabs, PiP doesn't open.

The PiP window staying open for the YT track without video is a bug (if we're basing it on the idea PiP wasn't intended for audio only). I was able to reproduce this by switching from a lyric video to an audio track. I've gone ahead and filed a new ticket here based on the STR you've given us https://bugzilla.mozilla.org/show_bug.cgi?id=2088641. Thanks for bringing this to our attention.

To be honest, I'd advocate for opening PiP for audio too, not only video, but I suspect that the intended behavior may be the opposite.

We have an old feature request https://bugzilla.mozilla.org/show_bug.cgi?id=1622991 that equally advocates for audio support. The exact reason why we wanted to hide PiP for audio is unknown to me, but we may reconsider the use case. I've linked this ticket to 1622991 since your comment is related.

Flags: needinfo?(kpatenio)
You need to log in before you can comment on or make changes to this bug.