mirror of
https://github.com/videojs/video.js.git
synced 2025-04-11 11:42:08 +02:00
Warning for previously updated players; doc update
This commit is contained in:
parent
a67201f913
commit
fc0730db98
@ -41,6 +41,8 @@ Step 2: Add an HTML5 video tag to your page.
|
||||
--------------------------------------------
|
||||
With Video.js you just use an HTML5 video tag to embed a video. Video.js will then read the tag and make it work in all browsers, not just ones that support HTML5 video. Beyond the basic markup, Video.js needs a few extra pieces.
|
||||
|
||||
> Note: The `data-setup` attribute described here should not be used if you use the alternative setup described in the next section.
|
||||
|
||||
1. The 'data-setup' Attribute tells Video.js to automatically set up the video when the page is ready, and read any options (in JSON format) from the attribute (see [options](options.md)). There are other methods for initializing the player, but this is the easiest.
|
||||
|
||||
2. The 'id' Attribute: Should be used and unique for every video on the same page.
|
||||
|
@ -37,6 +37,15 @@ var vjs = function(id, options, ready){
|
||||
|
||||
// If a player instance has already been created for this ID return it.
|
||||
if (vjs.players[id]) {
|
||||
|
||||
// If options or ready funtion are passed, warn
|
||||
if (options) {
|
||||
vjs.log.warn ('Player "' + id + '" is already initialised. Options will not be applied.');
|
||||
}
|
||||
if (ready) {
|
||||
vjs.log.warn ('Player "' + id + '" is already initialised. Ready function will not be executed.');
|
||||
}
|
||||
|
||||
return vjs.players[id];
|
||||
|
||||
// Otherwise get element for ID
|
||||
|
Loading…
x
Reference in New Issue
Block a user