Closed reyesvicente closed 5 years ago
Hey! Do you have the embed_video
application in your INSTALLED_APPS
as per the documentation?
What is your video URL? The package only supports YouTube, Vimeo, and SoundCloud videos at the moment. You can check out the support in the backends module.
Do you get a stacktrace or error of any kind from your templates or applications when you add the video or try to access it in your views?
Hey! Do you have the
embed_video
application in yourINSTALLED_APPS
as per the documentation?What is your video URL? The package only supports YouTube, Vimeo, and SoundCloud videos at the moment. You can check out the support in the backends module.
Do you get a stacktrace or error of any kind from your templates or applications when you add the video or try to access it in your views?
Yes, I have the embed_video
on my INSTALLED_APPS
.
I added the youtube URL on the Django Admin as a super user. Once I hit submit, the video got embedded INSIDE the admin, not on the template.
I saw a thumbnail error from one of the tags if I remember it correctly.
Well, it seems the admin works, so the problem is most likely with your template and HTML rendering. I'd check and fix any errors there first. YouTube videos should work correctly if they are public.
Well, it seems the admin works, so the problem is most likely with your template and HTML rendering. I'd check and fix any errors there first. YouTube videos should work correctly if they are public.
What's the easiest way to show it on the template? I need a row of 3 youtube videos.
How would you fix this?
Backend: {{ amlvideo.backend }}
URL: {{ amlvideo.url }}
Code: {{ amlvideo.code }}
Thumbnail: {{ amlvideo.thumbnail }}
HTTPS: {% if amlvideo.protocol == 'https' %}Yes{% else %}No{% endif %}
{% video amlvideo "large" %}
{% endvideo %}```
I got this error
Backend wasn't recognised (``) Traceback (most recent call last): File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/templatetags/embed_video_tags.py", line 112, in render backend = self.get_backend(url, context=context, **options) File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/templatetags/embed_video_tags.py", line 164, in get_backend else detect_backend(str(backend_or_url)) File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/backends.py", line 62, in detect_backend raise UnknownBackendException embed_video.backends.UnknownBackendException
If you take a look at the source code where the error happens you can see that the backend URL should be included in the error message, but it seems like your URL isn't resolved in the video
template tag correctly.
You are most probably using the template wrong and need to fix it. Try and remove lines one by one and see which line(s) break the functionality, then fix those parts.
The amount of source code in this package is fairly small so reading through the relevant error lines in the repository should prove helpful.
I got this error
Backend wasn't recognised (
) Traceback (most recent call last): File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/templatetags/embed_video_tags.py", line 112, in render backend = self.get_backend(url, context=context, options) File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/templatetags/embed_video_tags.py", line 164, in get_backend else detect_backend(str(backend_or_url)) File "/Users/user/Dev/Django/planetread/env/lib/python3.7/site-packages/embed_video/backends.py", line 62, in detect_backend raise UnknownBackendException embed_video.backends.UnknownBackendException `` This solved by error** @reyesvicent .. bind the video inside the for
home.html
{% load embed_video_tags %}
{% for items in allitems %}
{{items.title}}
{% video items.video as my_video %} {% video my_video "large" %} {% endvideo %} {% video my_video '800x600' %}{% endfor %}
views.py def home(request): allItems= Item.objects.all() context= {'allitems': allItems} return render(request, 'post/post_detail.html',context)
models.py
from embed_video.fields import EmbedVideoField class Item(models.Model): title = models.CharField(max_length=50) video = EmbedVideoField(verbose_name="My video", help_text="This is a help text") def unicode(self): return self.title
Posting a solution for the benefit of everyone:
...
{% load embed_video_tags %}
{% video item.video 'small' %}
...
{% if videos %}
{% for v in videos %}
{% video v.video as my %}
<iframe width="{{ 380 }}" height="{{ 225 }}" src="{{ my.url }}" frameborder="0" allowfullscreen></iframe>
{% endvideo %}
{% endfor %}
Hi,
I'm new in using this package. I followed the docs and everything is smooth sailing. But the videos won't show on the front end. On the admin, I placed the URL of a YouTube video for the models
on my template but it's not showing. Here are my ```models.py``` What could I do with this?video = EmbedVideoField(verbose_name='Videos', help_text='Videos of Translation')
and