Coder Social home page Coder Social logo

Comments (11)

thijstriemstra avatar thijstriemstra commented on June 15, 2024 1

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.

yetty avatar yetty commented on June 15, 2024

New backend to provide <video> functionality sounds great. I'm looking forward to your pull request.

from django-embed-video.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

@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.

yetty avatar yetty commented on June 15, 2024

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.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

@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.

yetty avatar yetty commented on June 15, 2024

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 the BackendTestMixin.

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.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

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.

mgrdcm avatar mgrdcm commented on June 15, 2024

@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.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

Sounds good @mgrdcm!

from django-embed-video.

thijstriemstra avatar thijstriemstra commented on June 15, 2024

Let me change the title of this ticket to HTML5 video or something. Video.js support can be integrated later.

from django-embed-video.

SalahAdDin avatar SalahAdDin commented on June 15, 2024

👍

from django-embed-video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.