Html5 Player

  

The most popular distribution was Adobe’s in-house Flash Player. HTML (Hypertext Markup Language) is designed to structure web documents. Through a series of text, tags, elements and attributes, web content is defined and translated to what the end-user sees on the browser, HTML employ these basic components to program enhanced. HTML5 Video Player 1.2.5 is available as a free download on our software library. The following versions: 1.2 and 1.0 are the most frequently downloaded ones by the program users. The program belongs to Multimedia Tools. This tool was originally developed by HTML5VideoPlayer.net.

Jump to:navigation, search

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.

HTML5 Player with flash fallback
Project stateClosed, released in 3.2
Tracker issuehttps://tracker.moodle.org/browse/MDL-38158
Discussionhttps://moodle.org/mod/forum/discuss.php?d=222753#p1110024
AssigneeMarina Glancy
Html5 Player

Project goals

The purpose of this document is to choose HTML5 player with flash fallback for integration in Moodle and plan its implementation.

The aim of this change is to reach a consistent look of the player among different platforms and browsers, as well as making sure that player starts using flash if html5 is not supported by browser for the given format. Another aim is to improve accessibility and usability, enhance customisation.

Considerations

  • Usability of the player - is it easy to use it and intuitively understand how to use controls?
  • Accessibility of the player - possibility of keyboard navigation, subtitles, support?
  • Appearance of the player - can its interface be modified, themes support, RTL?
  • Consistency among browsers - does player look the same?
  • Audio support - can player handle HTML5 <audio> tag?
  • Mobile platforms support - does player also work on iOS and Android?
  • Streaming media support (including adaptive-bitrate delivery) - can player handle RTMP, Apple HLS, Adobe HDS, Microsoft HSS?
  • Plugins support - can we use or develop community plugins easily?
  • Embedding support - so users could post media content outside Moodle, if permitted.
  • Maintainability of the links between the player and Moodle - how much work will we need to do every time we upgrade?

Candidates

  • ?Are there other alternatives?

Comparison Matrix

Flowplayer HTML5Video.JSProjekktorMediaElement.jsNo Player
Accessible Player:
  • Keyboard control
YesYes (http://accessibility.oit.ncsu.edu/blog/2013/05/09/accessible-video-js-player-available-on-global-accessibility-awareness-day/) This was instructed by Greg Krause, one of the key accessibility advisors for Moodle.Yes (configurable)YesYes
  • Subtitles support
YesYesYes (via plugin)YesYes (see http://caniuse.com/webvtt)
  • Touch interface
YesYesYesYesYes
Appearance:
  • Skins
Yes (via CSS)Yes (via CSS)Yes (via CSS)Yes (via CSS)Yes (via CSS)
  • CSS customisation
YesYesYesYesYes
  • RTL support
YesNoNoUnknown (CSS, so I guess so...)Yes
Mobile platforms:
  • iOS
YesNoYesYesYes
  • Android
YesNoYesYesYes
Streaming protocols:
  • RTMP
YesYesYes (via playlist)YesNo
  • Adaptive HTTP
HLSHLS (via plugin)HLS (via playlist)HLSvia Media Source Extension
  • MPEG-DASH
Yes (via plugin)Yes (via plugin)???
Audio playerNoYesYesYesYes
Embedding supportYes (configurable)Yes (via addThis plugin)Yes (via plugin)YesNo
LicenseGPL v3 (with additional terms)Apache 2GPL v3MITno extra code needed
JS libraryjQuery-jQueryjQuerynone required
Plugins infrastructureNoYesYesYesNo
Flash fallback playerFlowplayer Flashvideo-js flashStobeMediaPlayback (but can be jarisplayer or some other).Flash and Silverlight (for .wmv support) fallback, used to provide the HTML5 video/audio elements.The Video tag can contain fallback content (e.g. Flash object) for browsers that don't support it at all (http://camendesign.com/code/video_for_everybody), but not based on codec support.
APIYes (plus window.flowplayer object)YesYesYesYes

Flowplayer HTML5

Pros:

  • Good looking player, resembles existing flash flowplayer in Moodle (with 'functional' skin)
  • Extensive customisation (via CSS3 skins and configuration object)
  • Streaming support (RTMP, HLS)
  • Good accessibility features
  • Configurable embedding functionality
  • Existing flash flowplayer can be configured for fallback (the appearance of player will not be affected).

Cons:

  • Require jQuery for functioning
  • Flowplayer logo remains on screen

Technical notes (lessons learned from the prototypes)

  • Player initialisation is done using wrapper around <video>.
  • width and height attributes in video tag are ignored, player size is configured via wrapper size only.
  • RTMP server connection is configured via... dummy MIME type to force using plash player for whatever content.

Missing features

  • Plugins infrastructure
  • No audio support

Video.JS

Pros:

Update
  • No logo on screen.
  • Extensive API.
  • No extra JS library needed.
  • Many plugins.

Cons:

  • Poor documentation
  • RTMP requires non-standard MIME.
  • Android and iOS override Video.JS with own player, when not overridden, content is not playing.
  • No RTL.
  • HLS support via plugin (many files to include, external contributor see https://github.com/videojs/videojs-contrib-hls).

Technical notes (lessons learned from the prototypes)

  • Player initialisation is done using <video> tag directly (no wrapper needed).
  • RTMP server connection and path specified as single URI in src attribute of source item, '&' character is used as server connection and path divider.

Missing features

  • Embedded HLS support.

MediaElement.js

Pros:

  • Flash fall-forward - uses Flash/Silverlight to provide the HTML5 MediaElement API.
  • Consistent HTML/CSS Player
  • No logo on screen.

Cons:

  • ...

Technical notes (lessons learned from the prototypes)

  • ...

Missing features

  • ...

Projekktor

Pros:

  • No logo on screen.
  • Well documented API.
  • Media RSS support.
  • Possibility to choose flash player for fallback (included by default are StrobeMediaPlayback and Jarisplayer, both Open Source).
  • Platform preference order selection (e.g. browser, ios, android, flash, native).

Cons:

  • Uses flash where it is not supposed to (e.g. mp4 in Chrome).
  • Issues on ios and android (suggests to download file when play button is pressed).
  • RTMP only work if defined via playlist rather than in <source> tags.
  • Subtitles plugin is not free.

Technical notes (lessons learned from the prototypes)

  • Player initialisation is done using <video> tag directly (no wrapper needed).
  • Make sure <video> tag has class attribute with 'projekktor' value (even if you initialise it by ID of the element), player will not work properly otherwise.

Missing features


HTML5 browser native

Pros:

  • Simple
  • Standard on mobile

Cons:

  • IE8 has no support

Technical notes

Missing features

Cross-browser support

Method

Compatibility checks were done manually by accessing the sample page using different browsers and platforms. Sample page contained the list of identical player instances, initialised for each <video> definition with a <source> of particular format: mp4, webm, ogg, flv. Streaming support was checked by setting up a <video> container with two sources of the same video, one was HLS (Apple HTTP Live Streaming) stream for browsers and platforms that support html5 video streaming, another one was RTMP which is played using flash engine and supposed to be used in case if HLS is not supported.

Sample Pages

  • Flowplayer HTML5 version 5.4.6.
  • Video.JS version 4.4.1.
  • Projekktor version 1.3.09.
  • MediaElement.js version 2.6.14
  • Native browser support.

Source

Source of testing page is hosted on github. The actual source of the html page can be viewed in browser.

Discussion

The players comparison that has been carried out demonstrated that 'least hassle' player is Flowplayer. Despite some drawbacks listed in corresponding section above, it is clearly a winner as it works as expected and according to documentation for all browsers and platforms I had chance to test it. This is the only player that supports RTL layout, display platform incompatibility message prior to attempt to play, and was simple to configure (no undocumented tricks that I had to figure out to make it work). Both VideoJS and Projekktor do now perform properly in all cases. Among those two, I personally prefer Projekktor more for its extensive API, plugins infrastructure and configuration flexibility. However problems on mobile platforms and flash fallback inconsistency make them unreliable at this stage.

Compatibility results

The table was populated using Flowplayer as others do not perform good enough with some formats and platforms, e.g. VideoJS allow mobile platform player to override itself, Projekktor does not always use HTML5 where browser clearly can handle it (supported in native mode and Flowplayer).

Browsermp4webmoggflvRTMP/HLS*
Windows 7
  • Chrome 33.0.1750.117
html5html5html5flashflash
  • Firefox 27.0.1
html5html5html5flashflash
  • Opera 12.16
flashhtml5-flashflash
  • Safari 5.1.7
flash--flashflash
  • Internet Explorer 11.0.9600.x
html5--flashflash
Linux (Debian Wheezy)
  • Chrome 33.0.1750.115
html5html5html5flashflash
OSX 10.9
  • Safari 7.0 (9537.71)
html5--flashhtml5
  • Chrome 33.0.1750.117
html5html5html5flashflash
Android 4.2.2 phone (CyanogenMod, no flash)
  • Chrome 32.0.1700.99
html5html5---
  • Browser 4.2.2 (com.android.browser)
html5html5--html5
Android 4.2.2 tablet (GalaxyTab2, flash app 11.1.115.36)
  • Chrome 32.0.1700.99
html5html5---
  • Browser 4.2.2 (com.android.browser)
html5html5-flashhtml5
  • Opera 19.0.1340.x
html5html5---
iPhone 4S (6.1.3)
  • Safari
html5---html5
iPad 4 (7.0.6)
  • Safari
html5---html5

* For HLS/RTMP, html5 in the table means HLS has been used, flash means player fell back and used RTMP.

Player

Sub Tasks

In initial stage FlowPlayer HTML5 (or any other) will handle all existing HTML5 Video extensions as per core_media_player_html5video class, plus m3u8 (HLS). It will also be possible optionally to make flash files handled by HTML5 Video player as well (possibility of using existing flash FlowPlayer for flv files will remain).

Mock-Ups/Prototypes

See Sample pages section.

Workaround

As intermediate solution, if you require player consistency throughout all browsers and platforms, you may consider using JW Player filter: https://github.com/lucisgit/moodle-filter_jwplayer Notice, that JW Player is not free for commercial use.

Related Tracker Issues

Useful links

  • A mind map representation of using Video in various parts and plugins of Moodle.
Retrieved from 'https://docs.moodle.org/dev/index.php?title=HTML5_player&oldid=59713'
Player

The HTML <video> element is used to show a video on a web page.

Example

Courtesy of Big Buck Bunny:

Try it Yourself »

The HTML <video> Element

To show a video in HTML, use the <video> element:

Example

<video width='320' height='240' controls>
<source src='movie.mp4' type='video/mp4'>
<source src='movie.ogg' type='video/ogg'>
Your browser does not support the video tag.
</video>
Try it Yourself »

How it Works

The controls attribute adds video controls, like play, pause, and volume.

It is a good idea to always include width and height attributes. If height and width are not set, the page might flicker while the video loads.

The <source> element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.

The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.

HTML <video> Autoplay

To start a video automatically, use the autoplay attribute:

Example

<video width='320' height='240' autoplay>
<source src='movie.mp4' type='video/mp4'>
<source src='movie.ogg' type='video/ogg'>
Your browser does not support the video tag.
</video>
Try it Yourself »

Note: Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.

Add muted after autoplay to let your video start playing automatically (but muted):

Example

<video width='320' height='240' autoplay muted>
<source src='movie.mp4' type='video/mp4'>
<source src='movie.ogg' type='video/ogg'>
Your browser does not support the video tag.
</video>
Try it Yourself »Player

Browser Support

The numbers in the table specify the first browser version that fully supports the <video> element.

Element
<video>4.09.03.54.010.5

HTML Video Formats

There are three supported video formats: MP4, WebM, and Ogg. The browser support for the different formats is:

BrowserMP4WebMOgg
EdgeYESYESYES
ChromeYESYESYES
FirefoxYESYESYES
SafariYESYESNO
OperaYESYESYES

HTML Video - Media Types

File FormatMedia Type
MP4video/mp4
WebMvideo/webm
Oggvideo/ogg

HTML Video - Methods, Properties, and Events

The HTML DOM defines methods, properties, and events for the <video> element.

This allows you to load, play, and pause videos, as well as setting duration and volume.

There are also DOM events that can notify you when a video begins to play, is paused, etc.

Example: Using JavaScript



Video courtesy of Big Buck Bunny.

Try it Yourself »

Html5 Player Mac

For a full DOM reference, go to our HTML Audio/Video DOM Reference.

HTML Video Tags

Html5 Player Audio

TagDescription
<video>Defines a video or movie
<source>Defines multiple media resources for media elements, such as <video> and <audio>
<track>Defines text tracks in media players