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

(Request) Please add support for media features when playing videos from any site (including youtube) in full-screen and background like samsung browser has inbuilt in edge browser mobile addon. #470

Open
varniit-nigam-12 opened this issue Feb 10, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@varniit-nigam-12
Copy link

(Request) Please add support for media features when playing videos from any site (including YouTube) in full-screen and background like Samsung browser has inbuilt in edge browser mobile addon.

If you are aware dev, then your addon is now supported on edge mobile but as limitations are, you addon works on limited capabilities. I hope you can improve it for better video watching experience.

For more screenshots apart from these, you can the link below -

brave/brave-browser#35441

photo1707589362
photo1707589343

@polywock polywock added the enhancement New feature or request label Feb 10, 2024
@LifeJustDLC
Copy link

I'm sad it's a paid feature of youtube. I'm happy that globalSpeed is now an android edge support extension. I'm worried about whether it will last long.

As a temporary solution, you could:

  • request desktop version page
  • use 3rd party client e.g. NewPipe
  • I' not familiar with sumsung but there is a tool called "continue playing when screen off" in other Android platforms e.g. MIUI

But I should admit that maybe either UX of these sucks.

@polywock
Copy link
Owner

polywock commented May 3, 2024

@Varniit-pro-90s Hi. Apologies for the late reply. If I'm understanding correctly (not super familiar with Samsung browser or cococ), you want a small control overlay on each video? Which features in particular do you want accessible through this overlay? I'll look into implementing it. Edge-mobile specific features would be nice.

@LifeJustDLC
Copy link

LifeJustDLC commented May 3, 2024

I'll look into implementing it. Edge-mobile specific features would be nice.

@polywock If you're going to implement an always on virtual button (probably with gestures) to adjust speed and seeking for convenience as well. Maybe I can help with the UX design and coding.

BTW, I'm very exited that Edge had the official extension support recently. By leveraging globalSpeed and its ability to customize, the user experience could easily exceed any players on the market even including the native ones. (I actually kind of worried if youtube will make their intentionally weakened mobile site available to these powerful tools)

@polywock
Copy link
Owner

polywock commented May 3, 2024

@LifeJustDLC Hello. Thanks for the offer. Please don't pull/work on the current code available on Github as it's outdated. The draft release is significantly different.

I'm thinking of two Edge-mobile specifies features.

On-video gestures

  • This will be optional and opt-in as it may conflict with the website's existing gesture system.
  • holding down on a video to temporarily increase speed.
  • Double tap on the left/right side of a video to skip or advance by 10 seconds.

Video overlay control panel

  • Opt-out, but can be disabled in settings page.
  • Always visible in minimized form (very transparent).
  • Once touched, it will show the expanded form with all the controls
  • Playback rate will be one of the controls, but what else would be useful?

@LifeJustDLC
Copy link

LifeJustDLC commented May 9, 2024

@polywock Sorry for a late reply. I'm doing some investigation.

This will be optional and opt-in as it may conflict with the website's existing gesture system.

One of the possible conflicting gestures on YouTube is, dragging down in landscape full screen mode to exit from it. This might conflict with a speed decreasing gesture I used to plan. (I'll explain the details later.) But there's workaround, by dividing touch area into left, middle and right areas, assign only the middle area for site default behavior (exit landscape mode). Additionally, on portrait mode, we can choose to disable any custom gestures. Otherwise, make an right bottom corner, semitransparent hold-expand "dial" button, similar to the classical "bubble" on iPhone. (I don't have a name for it now, anyway, not urgent.)

(IMHO, preventing default behavior isn't necessarily a bad thing. I actually abused globalSpeed to prevent number keys and M key from functioning on YouTube.)

Besides, I don't think gesture system is a common thing, for the websites users mostly likely to use them. I observed a lot of sites using double tap to seek, but is it 10s base? or 5s base? Is it correlated with the current speed? Can it even be configured? I don't know. I'd rather use GS to define my own.

Once touched, it will show the expanded form with all the controls

That's "a little too more steps" I think. I'm currently doing some work about a gesture system (loading JavaScript by GS on Edge for Android), which is customizable by user, just like GS on desktop. You can consider any below "gesture" to be a "key", which can be bind to a specific function:

  • dragging up, In the right area. (increase playback rate)

  • dragging down, In the right area. (decrease playback rate)

  • dragging left, In the bottom area but above progress bar. (rewind)

  • dragging right, In the bottom area but above progress bar. (advance)

  • holding down on a video to temporarily increase speed.

    Of course, that would be great.*

  • etc....

The best part, "vibration feedback" on each discrete level crossing. Such as speed 1.0 -> 1.25 (0.25 is a level), seek now -> 2s before (2s is a level), and if it could be, configurable by user. This is good for user to feel the accurate time they are traveling. And freely cycling through any playback rates, even made desktop users jealous.

Several facts I found out recently: Firefox have disabled vibration API since 2020* (Safari doesn't support it at all). It officially support Android WebExtension development, but doesn't have a handy interactive screencast for devtools to inspect. Chrome still doesn't have mobile WebExtension support nowadays. Edge on Android only support 3 extensions officially (including GS) at the moment. It is like Chrome cannot load extensions to Android version. It seems able to load .crx now, but I still don't have any clue why my script is not appear in the page, after several days of debugging (guessing). So the only development solution falls on: Mostly on Android Firefox and finally test it on Android Edge (by manually copy paste JavaScript to devtools console.)

Playback rate will be one of the controls, but what else would be useful?

Volume boosting (over 100%) might be a necessity on such small devices. but IFAIK this is not implemented neither on desktop?

As for this specific issue, the screen-off-playing mode button. I don't know how would YouTube think if they find out this extension enable users to do what they don't want them to do. (I just found out today, that Edge (at least Canary) is actively announcing their ad blocking feature (AdBlock Plus under the hood) in the after-install user guide page...I'm a newbie in this world so maybe your decision is far from bold as I thought. Never mind. Doesn't do anything on YouTube ads as expected.) Anyway, I will offer my trivial help to this great project. Such as porting to Firefox on Android.

Additionally, I accidentally found that an alert can break YouTube pause-on-screen-off behavior, considering blocking visibilitychange event and manipulating document.hidden might not be a good idea. The down-side is that user have to close the prompt every time. I think it's an acceptable trade-off at this stage, except any better solution came out.

(If a long post isn't a good practice, from an experienced developer's perspective, apologizing for that and please let me know...)

@LifeJustDLC
Copy link

BTW, the current issue I'm trying to solve is latency/delay of the feedback sound effect (as I'm on Firefox, prohibiting vibration).

@polywock
Copy link
Owner

polywock commented May 9, 2024

Hello. Thanks for sharing those insights. I've been thinking it through and I'm very hesitant on doing of a gesture system, even if it's opt-in by user. I think it'll probably cause a lot of site-specific issues or require a lot of maintenance. Taking your feedback into consideration, maybe a little gesture circle that you can interact with to seek, change speed

Hold down for a few seconds to move it around.
Touch and drag right to seek right.
Touch and drag left to seek left.
Touch and drag up to increase speed.
Touch and drag down to decrease speed.
Touch and drag diagonally top-left to X.
... etc

Make this all customizable in the options page. Definitely not as convenient as gesture from anywhere on the video, but my main priority is writing Global Speed in such a way where maintenance is low or nothing. (That's how I get away with not updating GS in 2 years 😆 )

Volume boosting (over 100%) might be a necessity on such small devices. but IFAIK this is not implemented neither on desktop?

Global Speed does allow volume boosting, but only for Chromium browsers as the Tab Capture API isn't available on Firefox. However, even for Chromium, it's not suitable for gestures, etc as Chromium requires the user first invoke the extension before being allowed to manipulate audio, and only way to do that is through a browser-level shortcut key, click on extension toolbar icon, etc.

@888beside
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants