By default, this means that the Html5 tech is preferred, but Video.js will fall back to Flash if no Html5-compatible source can be found. For example:ĭefines the order in which Video.js techs are preferred. This should be an array of objects with the src and type properties. With sourceOrder: true, the algorithm becomes:Īn array of objects that mirror the native element’s capability to have a series of child elements. if tech can play source, use this tech/source combo.Presumably, it would first find a match between the FLV (since it’s first in the source order) and the Flash tech. It will look for a compatible tech for each source in order. However, because the sourceOrder is true, Video.js flips that process around. Normally, the fact that HTML5 comes before Flash in the techOrder would mean Video.js would look for a compatible source for HTML5 and would pick either the MP4 or WebM video (depending on browser support) only falling back to Flash if no compatible source for HTML5 was found. This supports having plugins be initialized automatically with custom options when the player is initialized - rather than requiring you to initialize them manually. notSupportedMessageĪllows overriding the default message that is displayed when Video.js cannot play back a media source. Note: Generally, this option is not needed and it would be better to pass your custom languages to videojs.addLanguage(), so they are available in all players! nativeControlsForTouchĮxplicitly set a default value for the associated tech option. The keys of this object will be language codes and the values will be objects with English keys and translated values. languagesĬustomize which languages are available in a player. This sets the initial language for a player, but it can always be changed. Type: string, Default: browser default or 'en'Ī language code matching one of the available languages in the player. A value of 0 indicates that there is no inactivityTimeout and the user will never be considered inactive. The inactivityTimeout determines how many milliseconds of inactivity is required before declaring the user inactive. Video.js indicates that the user is interacting with the player by way of the "vjs-user-active" and "vjs-user-inactive" classes and the "useractive" event. In other words, it will scale to fit its container.Īlso, if the element has the "vjs-fluid", this option is automatically set to true. When true, the Video.js player will have a fluid size. This option is inherited from the Component base class. The value should represent a ratio - two numbers separated by a colon (e.g. Puts the player in fluid mode and the value is used when calculating the dynamic size of the player. Video.js-specific OptionsĮach option is undefined by default unless otherwise specified. Sets the display height of the video player in pixels. The source URL to a video source to embed. The browser will wait until the user hits “play” to begin downloading. Sometimes, the meta data will be loaded by downloading a few frames of video. Load only the meta data of the video, which includes information like the duration and dimensions of the video. This tends to be the most common and recommended value as it allows the browser to choose the best behavior. This is why the value is called ‘auto’ and not something more conclusive like 'true'. Some mobile devices will not preload the video in order to protect their users’ bandwidth/data usage. Start loading the video immediately (if the browser supports it). Suggests to the browser whether or not the video data should begin downloading as soon as the element is loaded. As soon as the user hits “play” the image will go away. This is often a frame of the video or a custom title screen. posterĪ URL to an image that displays before the video begins playing. loopĬauses the video to start over as soon as it ends. Without controls the only way to start the video playing is with the autoplay attribute or through the Player API. controlsĭetermines whether or not the player has controls that the user can interact with. Note: As of iOS 10, Apple offers autoplay support in Safari. If true/present as an attribute, begins playback when the player is ready. Typically, defaults are not listed as this is left to browser vendors. Table of ContentsĮach of these options is also available as a standard element attribute so, they can be defined in all three manners outlined in the setup guide. To learn about passing options to Video.js, see the setup guide. Note: This document is only a reference for available options.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |