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

Question: get https embed url #34

Closed mpachas closed 10 years ago

mpachas commented 10 years ago

Hi, Reading docs I understand that is_secure=True/False depends on the request that renders the template.. When I want to offer a Video Player TwitterCard (from my http site) of a youtube video I need the HTTPS embed url (https://www.youtube.com/embed/video-code), the same with SoundCloud and others.. but when my templates renders {{ my_video.url }} it gives me the unsecured embed url. Could I force the protocol variable to be https or something like that? I think I could use a backend detection and use 'https://www.youtube.com/embed/{{my_video.code}}' but I wouldn't like to hardcode that on my templates.

Thank you,

yetty commented 10 years ago

No, currently it is not possible to enforce HTTPS. Why do you want to embed secured urls to insecure website?

mpachas commented 10 years ago

I'm not embedding it on my website, it is gonna be embedded in a tweet, but I need that https url to give it to Twitter meta tag twitter:player as you can read in https://dev.twitter.com/docs/cards/types/player-card#Reference

The use case is like this: I've my own posts in my django app, some of them include youtube videos, with some description and text, and I want that, when my post is shared via twitter, the video is shown using the specific Twitter Player Card, as you can see in the image.

twitter-cards-video

yetty commented 10 years ago

OK, it makes sense. I'll try to add feature to enforce https.

mpachas commented 10 years ago

Thank you,

yetty commented 10 years ago

Done. You can try it with latest development version. More info in #36.