Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Video options #261

Open
ford--prefect opened this issue Sep 23, 2017 · 7 comments
Open

Feature suggestion: Video options #261

ford--prefect opened this issue Sep 23, 2017 · 7 comments

Comments

@ford--prefect
Copy link

Hi,

I'd like to suggest to add options for video playback, so the software becomes more configurable.
This could either be done by en/dis-abling several options (autoplay, preload, loop etc) or just passing an options string right into the html5 video tag.
Thank you for considering.

@anarcat
Copy link
Contributor

anarcat commented Oct 25, 2017

@ford--prefect which options did you have in mind exactly? it may be useful to show a sample configuration file that would do what you need, for example. please expand what your use-case is.

@ford--prefect
Copy link
Author

ford--prefect commented Oct 25, 2017

The HTML5 video tag has several options controlling e.g. loading, showing controls, repeat mode, and autoplaying of the movie.
My wish would be to control these in a versatile way by either identifying a common set, that is made configurable each (see example 1 below) or just passing a config string to the video tag which is user defined and pasted into the html5 video tag (example 2).
This would allow to play videos in a user defined manner without fiddling with the source code.
I hope the examples illustrate the above. Dont hesitate to ask for further clarifications.

EDIT: Markdown ate my style, corrected.

===== Example 1 ====
sigal.conf.py:

[…]
#_ control video preload: auto, metadata or none (default: auto)
video_preload = "auto"
#_ control video autoplay: bool (default: True)
video_autoplay = True
#_ control video loop: bool (default: False)
video_loop = False
#_ display video controls: bool (default: True)
video_controls = True
[…]

produces html5 output like:

<video width="500" height="550" preload="auto" autoplay controls>
  <source src="sourcefile.mp4" type="video/mp4">
  <source src="sourcefile.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video> 

===== Example 2 ====
sigal.conf.py:

[…]
# video config string
video_config = 'preload="auto" autoplay loop controls"
[…]

produces html5 output like:

<video width="500" height="550" preload="auto" autoplay loop controls>
  <source src="sourcefile.mp4" type="video/mp4">
  <source src="sourcefile.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video> 

@anarcat
Copy link
Contributor

anarcat commented Oct 25, 2017 via email

@ford--prefect
Copy link
Author

According to the specification the full list is:

  • src - Address of the resource
  • crossorigin - How the element handles crossorigin requests
  • poster - Poster frame to show prior to video playback
  • preload - Hints how much buffering the media resource will likely need
  • autoplay - Hint that the media resource can be started automatically when the page is loaded
  • mediagroup - Groups media elements together with an implicit MediaController
  • loop - Whether to loop the media resource
  • muted - Whether to mute the media resource by default
  • controls - Show user agent controls
  • width - Horizontal dimension
  • height - Vertical dimension

not all of which are applicable here (e.g. width, height, src, crossorigin arent settings one sets for all videos at once). This is unlikely to change anytime soon, so adding these config variables makes sense in my view.

@saimn
Copy link
Owner

saimn commented Oct 28, 2017

I think I prefer the second option, to avoid the proliferation of settings, but no strong feelings (either one would be fine is someone wants to work on it 😉 )

@ford--prefect
Copy link
Author

I can look into this, but I have not much clue of your code at all. Do you have any contributor documentation with some hints how the subsystem interplay and maybe a tip where to start?
I haven't got much time, would try nonetheless.

@saimn
Copy link
Owner

saimn commented Nov 6, 2017

No real contributor documentation, sorry! But adding a new setting is easy (you can have a look at #270 or other PRs), and the settings dict is already available in the HTML templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants