Greasy Fork is available in English.

Custom Native HTML5 Player with Shortcuts

Custom html5 player with shortcuts and v.redd.it videos with audio

< 脚本Custom Native HTML5 Player with Shortcuts的反馈

评价:好评 - 脚本一切正常

§
发表于:2020-12-16
编辑于:2020-12-16

Amazing, works great with Imagus.

I have one problem lately, when hovering a v.reddit video link on Reddit with imagus the video pops up but the sound is muted. I have to tap M twice to get the sound to play. clips.twitch.tv works great, have sound by default.

Is there a way to set the sound on by default for v.reddit links?

Thanks

§
发表于:2020-12-17

Hmm. There's an issue where modern browsers don't allow audio to play without a user gesture, such as a click or hotkey. In Chromium, I use the `--autoplay-policy=no-user-gesture-required` command line switch. In FF, I believe the user gesture pref is in settings.

While audio is initializing, it is muted till synced, to avoid audio clipping. Mute state is also remembered on a per site basis, so if a video player was muted, the next video loaded would remain muted. I suppose it's possible that there's a bug somewhere, but this is the first report, and I can't repro, so I'd need clearer steps to do so.

§
发表于:2020-12-17

I get the same thing in Firefox 84.0, have to mute and unmute to get the audio to play.

§
发表于:2020-12-18

I can't repro in Firefox 84 either. I ran into the previously mentioned autoplay security issue, which can be re-enabled through the setting:



If that doesn't help, someone would need to show me the issue, since I'm not seeing it. Maybe a screen record.

§
发表于:2020-12-20
...If that doesn't help, someone would need to show me the issue, since I'm not seeing it. Maybe a screen record.

Here is a video, sorry for the quality and my accent.

§
发表于:2020-12-21

Well, I see what you mean now, but unfortunately, I can't repro any of these issues in either browser. I followed the link to that exact page and video, and all controls work as expected.

Someone else confirmed these issues, and clearly in the video, the controls are bugged. I thought a screen record might give me something to go on, in terms of reproducing, but it did not, and I'm not gonna be able to fix an issue I can't repro.

I'd suggest you test in a fresh browser profile, to check whether some other script/extension/config is interfering. Maybe test Chromium as well. I'd also suggest switching Imagus' right-click setting to 'click'. If you can somehow determine what's causing these issues, so that I can repro, perhaps they can be accounted for.

§
发表于:2020-12-21
编辑于:2020-12-21

For reference, here's a screen record of what I see in FF stable.

§
发表于:2020-12-21

You must be right, installed FF Dev and I don't have this problem I need to find which addon is the culprit

§
发表于:2020-12-21

I am at a loss, used a clean profile with only imagus, violentmonkey and your script and get the same problem.

The last thing I need to check is imagus v.redd.it sieve

here is mine:

"[vi].redd.it": {
    "link": "^(?:v\\.redd\\.it|(?:[^.]{2,5}\\.)?reddit\\.com/link/[\\da-z]+/video)(/[\\da-z]+).*",
    "url": "//v.redd.it$1/DASHPlaylist.mpd",
    "res": ":\nvar v=0,u,m=$._.match(/width=\"\\d+\">\\s*<BaseURL>([^<]+)/g)\nif(!m)return m\nm.forEach(function(m){\n m=m.match(/\"(\\d+)\">[^>]+>(.+)/)\n if(m[1] > v) {v=m[1]|0; u=m[2]}\n})\nreturn '//v.redd.it'+$[1]+'/'+u+'#mp4'",
    "img": "^preview(\\.redd.it/[^?]+)\\?.*",
    "to": ":\nreturn $[0].indexOf('format=mp4')>0 ? $[0]+'#mp4' : 'i'+$[1]"
  },

Maybe that's the culprit

§
发表于:2020-12-21
编辑于:2020-12-21

Alright, I can repro in ViolentMonkey. TamperMonkey works fine. Might be difficult to determine why it works as expected in one, and not the other, particularly since I'm not all that familiar with VM. @wOxxOm you've rewritten half of VM - any suggestions?

§
发表于:2020-12-21

Damn, installed Tampermonkey and turned off script on violentmonkey and it's working now.

§
发表于:2020-12-21

Seems like function sliderValues() does not work the same in VM. This is the main function for practically all events. Been a long while since I wrote that function. Might take a while to debug for VM compatability, if and when I can get around to it. Even if the code was buggy, which I don't doubt, kinda crazy that it works fine in TM, but not VM. For the most part, JS either works, or it doesn't. Shouldn't matter much how it's injected, but I guess it does.

§
发表于:2020-12-21

Well thank god we managed to pinpoint the problem, well mostly you.

And take your time. I'll use Tampermonkey for it for now

§
发表于:2020-12-24

Tweaked event handling and XHR API syntax for Violentmonkey/Greasemonkey compatibility. Seems to be working as expected now in those userscript managers. LMK if I missed anything.

§
发表于:2020-12-26

Awesome! It's working great now.

Well, a little nitpicking.

Merry Xmas and Happy New Year

发表回复

登录以发表回复。