jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.

Home Page:http://django-embed-video.rtfd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thoughts about youtube parameters

mpachas opened this issue · comments

Hi!
We are trying to get youtube captions work with django-embed-video approach.
Now django-embed-video extracts 'code' but ignores all the params stuff...
I think a smart idea would be to store them in a dict so them could be used later, maybe with some settings like 'ALLOW_YOUTUBE_CAPTIONS_PARAMETERS = TRUE', have you ever thought about something like that?

Thanks

Can you give more information, what do you think with "all the params stuff“? Some example of input and usage in application.

Ok: Imagine I have a youtube video with English and French captions, so I could use this url to force captions to load in french:

https://www.youtube.com/watch?v=7-VskJwqx88&cc_load_policy=1&cc_lang_pref=fr&hl=fr

When I use this url with YoutubeBackend I can't reach cc_load_policy, cc_lang_pref or hl values and use them when embedding the video, so the video embeds ok but captions are not activated by default.
The enhancement could be:

Maybe something like: ALLOWED_YOUTUBE_PARAMS = ['cc_load_policy', 'cc_lang_pref', 'hl', ... ]
check the full parameters list here: https://developers.google.com/youtube/player_parameters?hl=en

Parameter extraction via regular expressions

Compose query with video ID + allowed parameters extracted from url.

It makes sense. Better than regular expressions would be parameter extraction using urlparse. It would be great if you could create pull request with this functionality.

I will try, I'm working at a lot of projects nowdays.
El 14 abr. 2016 14:47, "Juda Kaleta" notifications@github.com escribió:

It makes sense. Better than regular expressions would be parameter
extraction using urlparse. It would be great if you could create pull
request with this functionality.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#55 (comment)

Also, if this is being worked on, please let the link also allow a start timestamp like in https://youtu.be/VIDEOSOMETHING?t=56m54s

oh. just realized how old this issue is... is the project still alive?

Makes sense. I have this in mind, but got no time

Is very old, Was this issue solved?

Can you make a small documentation about his parameters, his values and the way of youtube send they and why nedd you?

The official documentation for all possible parameters is here: https://developers.google.com/youtube/player_parameters#Parameters

Furthermore, as to "why" I'd love to use these parameters: A hobby project of mine is a web site called https://gtaracing.net where people upload descriptions of racetracks (amongst other stuff) for the video game GTA Online. On YouTube there are lots of videos regarding racing, and they are ideal to display on my website to showcase a track before you put it into your game. The bad thing is, that those videos often have multiple track showcases (e.g. https://youtu.be/JoYHeZLZuEE ), or the race starts after a couple of minutes. So for the users of the web site it is annoying going forward and backward until they see the real showcase.

Ok, i think we can pass it in a dictionary, in **kwargs values, but, can youtube urls receive this parameters and work with they or we need add native support for they?

I also need to be able to honor the t= (start time) parameter from youtube on my site.

commented

Also note that the regular watch URLs use parameters that look like t=30s or t=1m25s to encode the start time, but embed URLs need to convert that to start=30 or start=85. I am writing a custom template tag to handle that, would like to contribute the code to django-embed-video and delete it from my project!

@merwok can you propose a new PR?

commented

Busy at the moment but will find time later.