Comments (11)
Cool, I've started working on it here. Just switched to tox for testing against multiple Django/Pythons locally, now on to the real code.
from django-embed-video.
New backend to provide <video>
functionality sounds great. I'm looking forward to your pull request.
from django-embed-video.
@yetty I suppose as long as the URL is correct (verified by django's urlvalidator in the model or form field) we will try the 'BasicMediaBackend
' (what I called it for now, better suggestions for a name are welcome). This because a media URL doesn't necessarily have an extension (e.g. http://foo.com/myvideostream
). Should the code and thumbnail url always return None
? Maybe there should be a audio and video backend, so the user can decide if a certain field uses a specific backend (maybe a backend keyword with a dotted path to the backend)?
from django-embed-video.
There should be at least some checks, that given URL is valid. I guess the best solution would be to check, if server gives correct Content-Type
in response. Based on content type it would be used the propriate backend — video or audio.
For example if you use the video from http://www.quirksmode.org/html5/tests/video.html, the headers are
curl -XHEAD -i http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4
HTTP/1.1 200 OK
Date: Mon, 18 Apr 2016 11:02:40 GMT
Server: Apache/2.2.22 (Debian)
Last-Modified: Wed, 16 Feb 2011 14:20:59 GMT
ETag: "1d670c9-5416d8-49c66fd774813"
Accept-Ranges: bytes
Content-Length: 5510872
Content-Type: video/mp4
so video backend should be used.
I suggest the naming Html5VideoBackend
and Html5AudioBackend
.
from django-embed-video.
@yetty I've opened #58 with a backend that works here but there are still some quirks:
- we need sane defaults for width/height of the audio and video elements
- the tests need to be improved (what to do with urls that return 404, 301 etc, because adding a check for this causes the other backend tests to fail)
Any feedback is welcome.
from django-embed-video.
Thanks for all the spelling and grammar corrections! :)
- For video I would use the
default_size
. For audio there is no need of sizes. BackendTestMixin
is designed to run tests against real urls. (In fact it works more like integration test than like a unit test.) One way is to give working urls for Html5 backends too. Or write custom test cases for new backends, independent on theBackendTestMixin
.
I suggest next improvements:
- the templates for new backends are missing. We cannot use the default template.
- it would be fine if the template rendering would also be covered with tests.
- add some examples to initial data, to show how the functionality is working.
from django-embed-video.
Updated the PR @yetty
For video I would use the default_size. For audio there is no need of sizes.
I'm not sure how to change the default_size on a custom backend?
I've added some real urls. It seems to succeed on all builders except Django 1.5 and 1.6 on Python 3.4 (?!).
Also added the templates. Coverage remains the same. Leaving the initial data for the example up to you, I couldn't get it to work with Django 1.9.
from django-embed-video.
@thijstriemstra Since we're both now maintainers on this, would you be OK with me reviewing your changes (starting with this one), and you review mine should I have any?
from django-embed-video.
Sounds good @mgrdcm!
from django-embed-video.
Let me change the title of this ticket to HTML5 video or something. Video.js support can be integrated later.
from django-embed-video.
👍
from django-embed-video.
Related Issues (20)
- django.db.utils.OperationalError: no such table: posts_post HOT 1
- video unavailable HOT 6
- Emails to @mgrdcm not deliverable HOT 6
- GraphQL Youtube SSL problem: Max retries exceeded with url ... caused by NewConnectionError
- No thumbnails with Vimeo Backend HOT 1
- Suddenly stopped working on AWS. HOT 9
- django-embed-video attaches "_RvGGQVH" to video HOT 4
- Issues with testing on Pypy3 HOT 2
- Template and URL name
- Showing error HOT 4
- Polish translation HOT 3
- Adjust project settings to allow merging PRs HOT 2
- Add (Youtube) playlist support HOT 1
- django-embed-video==1.2 is rendering the iframe as HTTP rather than HTTPS. HOT 6
- example_project outdated HOT 2
- Option to disable request HOT 1
- adding classes HOT 1
- XSS possible in YoutubeBackend with user-provided URL HOT 2
- wrong path on installation.rst HOT 3
- Add Odysee support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-embed-video.