Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relation between html5 video player and video js

I am starting off on HTML5 and javascript and I have a basic doubt about video.js regarding the relation between HTML5 player/html "video" tag and video.js and the purpose of video.js. My specific questions are:

  1. Does video.js internally uses the HTML5 native player or does it create and use its own player?

If yes then:

a. Is there any other reason in using Video.js apart from the better look and feel and controls it provides. I understand that there are plugins available for video.js which have addition functionalities like playing HLS and DASH video etc, but here I am talking about the core video.js module.

b. Is it necessary to use the HTML5 player or it can be changed to use a custom player inside video.js

If answer to Q1 is no then:

a. If video.js is using its own player, then why does it even need a "video" tag in the HTML file for it to create and use its own player. This seems to indicate that there is some relation between the video.js and the HTML5 player.

b. Also I see that the constructor for the video.js seems to be called only when the "video" tag is parsed/loaded in the html file and not when the javascript file in included in the "head" section of the html. So what/how/who creates the mapping(if any) between the "video" element of HTML and video.js getting initialized.

like image 265
Archit Sinha Avatar asked May 13 '16 17:05

Archit Sinha


1 Answers

video.js it's checking if the browser supports the HTML5 in case it doesn't then it will run a flash player. Basically it provides you with browser compatibility.

like image 190
obsergiu Avatar answered Oct 24 '22 07:10

obsergiu