Skip to content
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

Duckplayer: 33. Fix video auto-pause issues #3929

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

afterxleep
Copy link
Collaborator

@afterxleep afterxleep commented Feb 5, 2025

Task/Issue URL: https://app.asana.com/0/1204099484721401/1209253933548270
Tech Design URL:
CC:

Description:
In some cases, when watching videos in DuckPlayer, videos pause after a few seconds when in Always Ask mode.

The issue involves a backgrounded tab. Although our JavaScript pauses the video every 10 ms, YouTube attempts to play an ad and succeeds. The ad plays briefly before our JavaScript pauses it, which is enough to hijack the audio session from the Duckplayer view, pausing the video.

This fix mutes the opener tab audio if "Open in new tab" is enabled. Thus, even if an ad plays briefly, it doesn't steal the audio session.

Steps to test this PR:

  1. Burn all data
  2. Go to Settings > DuckPlayer
  3. Make sure its in “Ask Every time” mode and Open videos in new tab is selected.
  4. Go to YouTube.com
  5. Tap the “You” tab on the bottom right
  6. Tap the settings gear icon in the top right
  7. Tap General
  8. Turn off the toggle for “Video previews”
  9. Close Settings and go back to Youtube
  10. Search for mkbhd
  11. Tap second video (Samsung Galaxy Something)
  12. Tap “Watch in Duck Player”
  13. Video should play without interruptions. (It was originally pausing at around 0:06s)

Definition of Done (Internal Only):

Internal references:

Software Engineering Expectations
Technical Design Template

@afterxleep afterxleep marked this pull request as ready for review February 5, 2025 17:37
@afterxleep afterxleep requested a review from Bunn February 6, 2025 13:18
@afterxleep afterxleep merged commit 4c8f852 into main Feb 6, 2025
55 checks passed
@afterxleep afterxleep deleted the daniel/duckplayer/33.fix.video.pause.issues branch February 6, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants