-
Notifications
You must be signed in to change notification settings - Fork 2
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
Problems with Video/Audio if media source is v.redd.it #4
Comments
ok, according to this post and many more angry posts, it is only possible to find a direct link using the fallback url in the json file. and even then, this file always does not contain any audio. it is possible to get the audio part by changing the filename from DASH_xxx.mp4 to DASH_audio.mp4 (example: https://v.redd.it/g5xu53hv97s61/DASH_audio.mp4), but this only gives you the audio part. There seem to be no direct why to retrieve a mp4 for both parts. :( nevertheless, stripping the inaccessible .webm source url from v.redd.it media would be an improvement. |
sorry for spamming here. I was thinking of a possible solution for this audio problem. This is some kind of a dirty hack, but actually working: if we are referencing the video and audio urls, it is possible to use javascript to play both at the same time. I have no idea if this is a good idea... we would need to randomly generate id's for every video/audio pair on that page (multiple posts) so the javascript is referencing the correct files, but we could maybe use the FreshRSS Flux id of the post?
edit: added onseeking function |
@rom-1 thank you for digging into that. I am not inclined to add such hack in the extension. I've noticed that there was some discrepancies on some videos but I never searched how to fix that. The video support in this extension is a bonus. When I started it, I wanted to have image support hence the name. |
Sure, that's fine with me. I agree that this is solution would be a really dirty hack. Because of the way v.redd.it delivers it's media files, currently I see no good way to enhance the handling of the audio part with video files for now. BUT this still leaves one "bug" I mentioned in this issue: could you leave out the faulty .webm source url? that would be quite helpful for 3rd party applications. v.redd.it has no .webm file, and linking to it as a source file results in some errors on my side. |
You're right! Could you open a separate issue for that to keep track of it? Thank you! |
@rom-1 Do you know if the hack you've mentioned is working? I am working on that at the moment and I am trying to figure how to include correctly the audio tag. I do not want to spend some time for nothing. Thank you for your feedback. |
yep, this actually seems to work for me, I tried it by testing it with an empty html file. example:
the video does not have audio when pressing "play". if we change the source code to this, it still shows no audio (speaker icon is greyed out), but actually we have sound when pressing play. please note that I used the flux id of the particular post for every id used in this part.
also, please note that the audio part has not to be within the video tag. you could place the audio part below the video part, but this would mean that the audio part would be rendered as a separate control below the video. |
Thank you for those tests. I will add the audio tag but not the javascript. |
Sure thing, thank you! I will give it a try once it's available. 🙂 |
@rom-1 I've added the audio tag in the video tag for v.redd.it videos. It's not released yet but you can still try it. Let me know what you think. There is a section in the readme for that. |
Thanks! I just gave it a try, but unfortunately it looks like the audio tag is not embedded in html. I double checked Media/Video.php on my webspace, and it contains the new code you added. Results in this html post in FreshRSS:
|
There is 2 transformers. One for display (executed each time you display an article), one for insertion (executed once when the feed is read). I've added it in the insertion transformer. |
I rework the extension to do most of the work during insertion since it's pretty heavy to process api. |
ok, looks I have no clue what I am talking about. I don't understand it, sorry. I thought the "audio" tag has to be within the html somewhere, so my browser sees which audio file has to be played/loaded. otherwise, the browser does not have any clue about the source path to the audio file. so, the current state with the new extension code is: it does not work for me. I inserted the javascript into the CustomJS and the audio file does not play |
ahh!! this is the reason for my problems. ok then, lets wait a bit until there is a new media post coming from reddit 😂 |
You can make some tests with https://reddit.com/user/Palifaith/submitted/.rss Here is what I have in my DOM for that kind of content: <div class="reddit-image figure">
<!--xExtension-RedditImage | InsertTransformer | Reddit video-->
<video controls="1" preload="metadata" class="reddit-image">
<audio controls="1">
<source src="https://v.redd.it/ciild7rrogv61/DASH_audio.mp4">
</audio>
<source src="https://v.redd.it/ciild7rrogv61/DASH_480.mp4" type="video/mp4">
</video>
</div> |
Thanks, this helped. In the feed you mentioned, there is this post: https://www.reddit.com/r/nextfuckinglevel/comments/mhirwn/people_buy_out_entire_stores_doughnuts_so_the/ This results in the following html code:
so far, so good. When pressing the play button on one of the videos, I am now receiving a Javascript Console Error:
maybe this matters because my default view in FreshRSS is, to "unfold articles by default" so the JS does not find a valid target? |
so... turns out, the JS error only appears if the media file does not have audio, or if the file is hosted at gifycat instead of v.redd.it (but should have audio, though). So the JS error can be ignored for now. Nevertheless: It unfortunately it does not work for me. Pressing "play" does not have any effect on the audio part, and I have no clue why not. I guess the JS code does not add a listener as it should do? do you have any tips how I could debug this any further? |
Have you tried the snippet in the readme directly in your console? The snippet is really simple, it does not check if there is audio, it does not stop or pause the video. |
ok, after a lot of tries, I finally figured my problem out. and it's embarassing, I hope you have a good laugh: So, this works flawless now. I am using the following javascript for a better experience, if you want to update your readme file:
of course, this does not work in the FeedMe Android App. I guess the app is stripping all kind of javascript or the extension CustomJS is not even used when displaying posts within the app. I think that is as far as you can get to enable v.redd.it videos with your extension to play flawless, thanks a lot for your help! |
We've all made similar mistake, don't beat yourself up. I am guessing that the snippet you provided does not work on articles that are loaded while scrolling. Could you confirme? I will update the readme file with your content. Thank you! |
mh.. no? I have not seen any bad side effects while scrolling, all videos have audio and seeking works as expected. I am using lazy loading if that helps? |
OK, good. I guess that the CustomJS extension has some kind of handler to do that. Which makes sense. |
I'll add your example in the readme and I'll close that issue afterward. Except if you have something that is not addressed in what I have done. |
Not that I am aware of. Go ahead 🙂 |
So, maybe there is no solution to this, but I just want to give it a try and ask you this.
(Side Note: In the RedditImage-Extension I did not enable the option to mute videos, so every video should play with audio.)
This is example Reddit Post A: https://www.reddit.com/r/interestingasfuck/comments/mnjke0/the_bionic_woman/
It embeds a video from gfycat.com. The source code in FreshRSS of the post is:
This post works flawless in any scenario:
This is example Reddit Post B: https://www.reddit.com/r/nextfuckinglevel/comments/mnouq4/learning_to_sing/
It embeds a video from v.redd.it. The source code in FreshRSS of the post is:
Posts who embed media from v.redd.it are almost never working. I experience the following problems:
So somehow, on reddit.com, the video does contain audio. I have no idea why it is missing audio in FreshRSS or using the direct mp4 link. Also, if the webm url never works with v.redd.it, it should not be listed as an available source in html, as this is confusing for 3rd party software.
Hope this makes sense ;)
The text was updated successfully, but these errors were encountered: