Closed sunjoomoon closed 10 years ago
Please provide more details about your problem - I need to know exact url to determine the problem. It should be helpful to provide you version of django-embed-video, too. Validation in administration should work fine.
sorry for the late one. here comes my environment- django-embed-video==0.9 and django == 1.6.5
Enterting correct url like below, http://www.youtube.com/watch?v=gauN0gzxTcU -> works fine
but often clients enter wrong youtube url.. for example, http://www.youtube.com/edit?video_id=eBea01qmnOE returns below
Error during template rendering
In template /../../embed_video/templates/embed_video/embed_code.html, error at line 1
(Could not get exception message)
1 <iframe width="{{ width }}" height="{{ height }}" src="{{ backend.url }}" class="video-frame" allowfullscreen></iframe>
So, hope if youtube video url format is not correct, then show warning message while saving. Any advice? Thanks.
Validation of urls has been improved, so if you use EmbedVideoFormField
, invalid urls will raise ValidationError
.
Thank you Juda. As per your advice, all went fine now. I upgraded to 0.10. I repeated the same and here is the result. 1) http://www.youtube.com/edit?video_id=eBea01qmnOE #saved ok, video plays in browser. OK 2) wrong url was tried but warning message came up before saving, like a typical django message. Thanks again, this helps me and clients as well a lot.
Thank you guys, this is really helpful.
How to validate if youtube video url format is correct before saving? Wrong url format saved returns error both in the browser and admin page.