jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

Thoughts about youtube parameters #55

Closed mpachas closed 4 months ago

mpachas commented 8 years ago

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

yetty commented 8 years ago

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

mpachas commented 8 years ago

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.

yetty commented 8 years ago

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.

mpachas commented 8 years ago

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 https://github.com/yetty/django-embed-video/issues/55#issuecomment-209922931

abecede753 commented 7 years ago

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

abecede753 commented 7 years ago

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

mpachas commented 7 years ago

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

SalahAdDin commented 7 years ago

Is very old, Was this issue solved?

mpachas commented 7 years ago

@SalahAdDin no

SalahAdDin commented 7 years ago

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

abecede753 commented 7 years ago

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.

mpachas commented 7 years ago

I think it would be useful to be able to allow/deny/override those (all) parameters.

2017-03-13 14:00 GMT+01:00 abecede753 notifications@github.com:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jazzband/django-embed-video/issues/55#issuecomment-286100171, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKdlWoJzhPp24vjDSmnvtBcfi7yplyIks5rlT4EgaJpZM4IFQNV .

SalahAdDin commented 7 years ago

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?

joelschopp commented 7 years ago

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

merwok commented 6 years ago

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!

mpachas commented 6 years ago

Please do it, Thanks

El jue., 15 mar. 2018 21:58, Éric Araujo notifications@github.com escribió:

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!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jazzband/django-embed-video/issues/55#issuecomment-373520620, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKdlYQ8PcgaHixJlkZK9WZdvbpPEiH1ks5tetXagaJpZM4IFQNV .

SalahAdDin commented 6 years ago

@merwok can you propose a new PR?

merwok commented 6 years ago

Busy at the moment but will find time later.