男的结扎有什么影响| 6月17什么星座| 梦见生小孩是什么征兆| 被蜜蜂蛰了用什么药| 九品芝麻官是什么级别| 手爆皮是什么原因| 淋病吃什么药| 怀孕胸部会有什么反应| 试金石是什么意思| 塑料是什么垃圾| 右眼跳是什么兆头| 阿普唑仑片是什么药| 满江红属于什么植物| 毛主席女儿为什么姓李| 心什么肉什么| 美国为什么不敢打伊朗| 人吸了甲醛有什么症状| 白天嗜睡是什么原因| 乙巳年是什么命| 喜极而泣的意思是什么| 备皮什么意思| 日安什么意思| 梦见抓蝎子是什么意思| 怀孕周期是从什么时候开始算的| 什么生机| 巨蟹和什么星座最配对| 皮肤镜能检查出什么| 什么是血友病| 纳差什么意思| 为什么月经迟迟不来又没怀孕| 尚清是什么意思| 明天什么日子| 儿童手足口病吃什么药| 屁多还臭是什么原因| 痔疮和肛周脓肿有什么区别| 粽子是什么意思| 岩茶是什么茶类| 未羊是什么意思| 腹痛拉肚子吃什么药| 房间消毒杀菌用什么好| 成字五行属什么| 滥竽充数的滥是什么意思| 孙策和孙权什么关系| 梦见海龟是什么意思| 云母是什么东西| 软组织损伤是什么意思| 足字旁的字和什么有关| 晚上五点是什么时辰| 肝胆相照是什么意思| 6月6号是什么日子| 白居易号什么居士| 新陈代谢是什么| 尿液发黄是什么原因| 淘宝什么时候成立的| 43岁属什么| 驻外大使是什么级别| 人造海蜇丝是什么做的| 排骨炖什么最好吃| 栉风沐雨什么意思| 什么是溶血性贫血| 融合菜是什么意思| 甘油三酯高吃什么食物降得快| 脸上长肉疙瘩是什么原因| 打卤面都有什么卤| 阴阳八卦是什么生肖| 什么原因不来月经| 齿痕舌是什么原因| 浑身发热是什么原因| dr检查是什么| 玹字五行属什么| 我行我素是什么意思| 生殖器疱疹擦什么药| 女人经期吃什么食物好| 脑梗吃什么中药| 什么运动瘦大腿| 梦见捡了好多钱是什么预兆| 黄晓明的老婆叫什么名字| 关节炎用什么药最好| 儿童脾胃不好吃什么调理脾胃| 血小板低是什么问题| 什么的原野| 河堤是什么意思| 桃子有什么功效| 痰湿吃什么食物| 二进宫是什么意思| 什么叫化疗| 打了麻药有什么副作用| 努尔哈赤是什么意思| 屠苏是什么意思| 左边肋骨下面是什么器官| 眼睛模糊用什么药好| 为什么吃辣的就拉肚子| 骨折什么感觉| 唯我独尊是什么意思| 胆囊切除有什么后遗症| 风热感冒和风寒感冒有什么区别| 卵泡破裂是什么意思| 芳华是什么意思| 缺钙吃什么食物| 夏天有什么植物| 宫颈粘液栓是什么样的| 京酱肉丝是什么菜系| 嘌呤是什么意思| 梦见考试是什么预兆| 舌头裂纹是什么病| 甲状腺是什么科| 无为而治是什么意思| 马拉松起源与什么有关| 胸口闷闷的有点疼是什么原因| 大姑姐是什么意思| 开除党籍有什么影响| 劓刑是什么意思| 盆腔少量积液是什么意思| loves是什么意思| yaoi是什么| 胃气不通什么症状| 腹部胀疼是什么原因| 湿气重吃什么食物| 吝啬的意思是什么| 灰指甲是什么样子| mcn是什么意思| 含服是什么意思| 溢字五行属什么| 打呼噜什么原因| 歹且念什么| 菠萝和凤梨有什么区别| 男生腿毛旺盛说明什么| 处暑什么意思| 金刚石是由什么构成的| 肠腺瘤是什么病| 鹿晗什么星座| 青瓜和黄瓜有什么区别| 头晕恶心吃什么药| 牙龈肿胀吃什么药| 为什么喜欢春天| 非农业户口是什么意思| 坐骨神经痛是什么原因引起的| 大姨妈来了不能吃什么东西| 植树节是什么季节| 委屈是什么意思| 阴虱是什么样子图片| 世界7大奇迹是什么| 妇科检查bv是什么意思| 有什么方法可以快速入睡| r级是什么意思| 白带是什么颜色| 汉武帝是什么朝代| 白细胞和淋巴细胞偏高是什么原因| 什么的天| 红参和人参有什么区别| 为什么打哈欠会流眼泪| 腿血栓什么症状| pt是什么材质| 祸水什么意思| 朱雀玄武是什么意思| 儿童拉肚子吃什么药| 胎动少是什么原因| 226是什么意思| 贴图是什么意思| 摩罗丹主要治什么胃病| 鸡蛋黄发红是什么原因| 像狐狸的狗是什么狗| 补液是什么意思| 沙漠有什么动物| 脑干出血是什么原因造成的| 楼房风水主要看什么| 桥本甲状腺炎吃什么药| 甜瓜什么时候成熟| lot是什么意思| 念叨是什么意思| 老炮儿是什么意思啊| 老虎属于什么科动物| 安德玛是什么牌子| 手抖是什么原因| 二十年婚姻是什么婚| 智齿冠周炎吃什么消炎药| 喉咙痰多吃什么药最好| 随访复查什么意思| 直男是什么意思| 犬和狗有什么区别| 血压偏低有什么症状| 长颈鹿的脖子像什么| 什么是性骚扰| 啤酒有什么牌子| 跪安是什么意思| 女人有卧蚕代表什么| 心脏痛挂什么科| 青岛为什么叫青岛| 梗米是什么| 什么情况下要打破伤风针| 生物钟什么意思| 命途多舛是什么意思| 女生是什么意思| 天下乌鸦一般黑是什么生肖| 指甲开裂是什么原因| 鲁班是什么家| 急性肾炎什么症状| pangchi是什么牌子的手表| 西西里的美丽传说讲的什么| 九浅一深是什么意思| 属蛇的是什么命| 紫薇花什么季节开花| 无花果什么时候种植| plein是什么牌子| 百合花代表什么| 静脉注射是什么意思| nos是什么单位| 戴银饰变黑是什么原因| 什么是职业暴露| 黄精药材有什么功效| 指甲上的白色月牙代表什么| 七四年属什么生肖| 头发油是什么原因| 什么样的柳树| 脚酸疼是什么原因引起的吗| 假性宫缩是什么感觉| 萧何字什么| 玄凤鹦鹉吃什么| 便潜血阳性什么意思| 蛋白质是由什么组成的| 胸透检查什么| 舌头溃疡吃什么药| 发offer是什么意思| 3.7号是什么星座| 小傻瓜是什么意思| 更年期什么时候| 召力念什么| 什么是心悸有什么症状| 查过敏原挂什么科| 蕃秀什么意思| 尿频去药店买什么药| 紧急避孕药什么时候吃| 中国的国菜是什么| 大专跟本科有什么区别| 胎毒是什么样子的图片| 非典型细胞是什么意思| 下雨天穿什么衣服| 乘载和核载是什么意思| 梨子煮水喝有什么功效| 用白醋泡脚有什么好处| 什么药能治阳痿早泄| 鼻子毛白了是什么原因| 膝盖痛是什么原因| 荨麻疹是什么病| 手舞足蹈是什么生肖| lp0是什么意思| 青海有什么好玩的| 地球是什么| 香港特首什么级别| 什么是环境影响评价| 脚气是什么| 舌苔发苦是什么原因| 同学过生日送什么礼物好| 什么头什么颈| 清白是什么意思| gson是什么牌子| 常温保存是什么意思| 梦见怀孕的女人是什么意思| 脑供血不足用什么药好| 褐色分泌物是什么原因引起的| 探花是什么意思| 前戏是什么意思| 胆在什么位置图片| 男人为什么累| 百度

厦大博士国家助学金补助提高 每人每年多3000元

Video.js Guides

百度 民营经济,占据湖北经济总量的半壁江山。

These guides cover a range of topics for users of Video.js

Video.js Options Reference

Note: This document is only a reference for available options. To learn about passing options to Video.js, see the setup guide.

Standard <video> Element Options

Each of these options is also available as a standard <video> element attribute; so, they can be defined in all three manners outlined in the setup guide. Typically, defaults are not listed as this is left to browser vendors.

autoplay

Type: boolean|string NOTE: At this point, the autoplay attribute and option are NOT a guarantee that your video will autoplay. NOTE2: If there is an attribute on the media element the option will be ignored. NOTE3: You cannot pass a string value in the attribute, you must pass it in the videojs options

Instead of using the autoplay attribute you should pass an autoplay option to the videojs function. The following values are valid:

  • a boolean value of false: the same as having no attribute on the video element, won't autoplay
  • a boolean value of true: the same as having attribute on the video element, will use browsers autoplay
  • a string value of 'muted': will mute the video element and then manually call play() on loadstart. This is likely to work.
  • a string value of 'play': will call play() on loadstart, similar to browsers autoplay
  • a string value of 'any': will call play() on loadstart and if the promise is rejected it will mute the video element then call play().

To pass the option

var player = videojs('my-video', {
  autoplay: 'muted'
});

// or

player.autoplay('muted');

More info on autoplay support and changes:

controlBar.remainingTimeDisplay.displayNegative

Type: boolean

Bu default the remaining time display shows as negative time. To not show the negative sign set controlBar.remainingTimeDisplay.displayNegative to false.

controls

Type: boolean

Determines whether or not the player has controls that the user can interact with. Without controls the only way to start the video playing is with the autoplay attribute or through the Player API.

height

Type: string|number

Sets the display height of the video player in pixels.

loop

Type: boolean

Causes the video to start over as soon as it ends.

muted

Type: boolean

Will silence any audio by default.

poster

Type: string

A URL to an image that displays before the video begins playing. This is often a frame of the video or a custom title screen. As soon as the user hits "play" the image will go away.

preload

Type: string

Suggests to the browser whether or not the video data should begin downloading as soon as the <video> element is loaded. Supported values are:

'auto'

Start loading the video immediately (if the browser supports it). Some mobile devices will not preload the video in order to protect their users' bandwidth/data usage. This is why the value is called 'auto' and not something more conclusive like 'true'.

This tends to be the most common and recommended value as it allows the browser to choose the best behavior.

'metadata'

Load only the meta data of the video, which includes information like the duration and dimensions of the video. Sometimes, the meta data will be loaded by downloading a few frames of video.

'none'

Don't preload any data. The browser will wait until the user hits "play" to begin downloading.

src

Type: string

The source URL to a video source to embed.

width

Type: string|number

Sets the display width of the video player in pixels.

Video.js-specific Options

Each option is undefined by default unless otherwise specified.

aspectRatio

Type: string

Puts the player in fluid mode and the value is used when calculating the dynamic size of the player. The value should represent a ratio - two numbers separated by a colon (e.g. "16:9" or "4:3").

Alternatively, the classes vjs-16-9, vjs-9-16, vjs-4-3 or vjs-1-1 can be added to the player.

audioOnlyMode

Type: boolean Default: false

If set to true, it asynchronously hides all player components except the control bar, as well as any specific controls that are needed only for video. This option can be set to true or false by calling audioOnlyMode([true|false]) at runtime. When used as a setter, it returns a Promise. When used as a getter, it returns a Boolean.

audioPosterMode

Type: boolean Default: false

If set to true, it enables the poster viewer experience by hiding the video element and displaying the poster image persistently. This option can be set to true or false by calling audioPosterMode([true|false]) at runtime.

autoSetup

Type: boolean

Prevents the player from running the autoSetup for media elements with data-setup attribute.

Note: this must be set globally with videojs.options.autoSetup = false in the same tick as videojs source is loaded to take effect.

breakpoints

Type: Object

When used with the responsive option, sets breakpoints that will configure how class names are toggled on the player to adjust the UI based on the player's dimensions.

By default, the breakpoints are:

Class NameWidth Range
vjs-layout-tiny0-210
vjs-layout-x-small211-320
vjs-layout-small321-425
vjs-layout-medium426-768
vjs-layout-large769-1440
vjs-layout-x-large1441-2560
vjs-layout-huge2561+

While the class names cannot be changed, the width ranges can be configured via an object like this:

breakpoints: {
  tiny: 300,
  xsmall: 400,
  small: 500,
  medium: 600,
  large: 700,
  xlarge: 800,
  huge: 900
}
  • The keys of the breakpoints object are derived from the associated class names by removing the vjs-layout- prefix and any - characters.
  • The values of the breakpoints object define the max width for a range.
  • Not all keys need to be defined. You can easily override a single breakpoint by passing an object with one key/value pair! Customized breakpoints will be merged with default breakpoints when the player is created.

When the player's size changes, the merged breakpoints will be inspected in the size order until a matching breakpoint is found.

That breakpoint's associated class name will be added as a class to the player. The previous breakpoint's class will be removed.

See the file sandbox/responsive.html.example for an example of a responsive player using the default breakpoints.

children

Type: Array|Object

This option is inherited from the Component base class.

disablePictureInPicture

Type: boolean

If true, switching the video element into picture-in-picture is disabled. Default is false.

This has no effect on Firefox's proprietary picture-in-picture mode which does not implement the standard picture-in-picture API.

This does not disable the document picture-in-picture mode which allows the player element to put into a PiP window.

enableDocumentPictureInPicture

Type: boolean

Since 8.3.0

If true, the documentPictureInPicture API will be used for picture-in-picture, if available. Defaults to false, but may default to true when the feature has become established.

Supported by Chrome and Edge from version 116.

This is a different picture-in-picture mode than has previously been available, where the entire player element is windowed rather than just the video itself. Since there are scenarios where it would be desirable to allow PiP on the player but not PiP on the video alone (such as ads, overlays), the disablePictureInPicture option only disables the old-style picture-in-picture mode on the video.

enableSmoothSeeking

Type: boolean Default: false

Since 8.9.0

If set to true, will provide a smoother seeking experience on mobile and desktop devices.

The following will enable the smooth seeking:

videojs('my-player', {
  enableSmoothSeeking: true
});

Can also be modified after player creation:

var player = videojs('my-player');

player.options({ enableSmoothSeeking: true });

experimentalSvgIcons

Type: boolean

Since 8.5.0

If set to true, the icons used throughout the player from videojs/font will be replaced by SVGs stored in Video.js. Defaults to false, but may default to true when the feature has become established.

These SVGs were downloaded from Font Awesome and Google's Material UI.

You can view all of the icons available by renaming sandbox/svg-icons.html.example to sandbox/svg-icons.html, building Video.js with npm run build, and opening sandbox/svg-icons.html in your browser of choice.

Icons are expected to be added to a Component inside of the player using the setIcon method when customizing the player.

fluid

Type: boolean

When true, the Video.js player will have a fluid size. In other words, it will scale to fit its container at the video's intrinsic aspect ratio, or at a specified aspectRatio.

Also, if the <video> element has the "vjs-fluid", this option is automatically set to true.

fullscreen

Type: Object Default: {options: {navigationUI: 'hide'}

fullscreen.options can be set to pass in specific fullscreen options. At some point, it will be augmented with element and handler for more functionality.

options

Type: Object Default: {navigationUI: 'hide'}

See The Fullscreen API Spec for more details.

id

Type: string

If provided, and the element does not already have an id, this value is used as the id of the player element.

inactivityTimeout

Type: number

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.

The inactivityTimeout determines how many milliseconds of inactivity is required before declaring the user inactive. A value of 0 indicates that there is no inactivityTimeout and the user will never be considered inactive.

language

Type: string, Default: browser default or 'en'

A language code matching one of the available languages in the player. This sets the initial language for a player, but it can always be changed.

Learn more about languages in Video.js.

languages

Type: Object

Customize which languages are available in a player. The keys of this object will be language codes and the values will be objects with English keys and translated values.

Learn more about languages in Video.js

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!

liveui

Type: boolean Default: false

Allows the player to use the new live ui that includes:

  • A progress bar for seeking within the live window
  • A button that can be clicked to seek to the live edge with a circle indicating if you are at the live edge or not.

Without this option the progress bar will be hidden and in its place will be text that indicates LIVE playback. There will be no progress control and you will not be able click the text to seek to the live edge. liveui will default to true in a future version!

liveTracker.trackingThreshold

Type: number Default: 20

An option for the liveTracker component of the player that controls when the liveui should be shown. By default if a stream has less than 20s on the seekBar then we do not show the new liveui even with the liveui option set.

liveTracker.liveTolerance

Type: number Default: 15

An option for the liveTracker component of the player that controls how far from the seekable end should be considered live playback. By default anything further than 15s from the live seekable edge is considered behind live and everything else is considered live. Any user interaction to seek backwards will ignore this value as a user would expect.

nativeControlsForTouch

Type: boolean

Explicitly set a default value for the associated tech option.

normalizeAutoplay

Type: boolean

Specify whether setting autoplay: true and <video autoplay> should be treated the same as autoplay: 'play', i.e. the autoplay attribute should be removed from (or not added to) the video element and play() be initiated manually by Video.js rather than the browser.

notSupportedMessage

Type: string

Allows overriding the default message that is displayed when Video.js cannot play back a media source.

noUITitleAttributes

Type: boolean Default: false

Control whether UI elements have a title attribute. A title attribute is shown on mouse hover, which can be helpful for usability, but has drawbacks for accessibility. Setting noUITitleAttributes to true prevents the title attribute from being added to UI elements, allowing for more accessible tooltips to be added to controls by a plugin or external framework.

playbackRates

Type: Array

An array of numbers strictly greater than 0, where 1 means regular speed (100%), 0.5 means half-speed (50%), 2 means double-speed (200%), etc. If specified, Video.js displays a control (of class vjs-playback-rate) allowing the user to choose playback speed from among the array of choices. The choices are presented in the specified order from bottom to top.

For example:

videojs('my-player', {
  playbackRates: [0.5, 1, 1.5, 2]
});

playsinline

Type: boolean

Since 6.1.0

Indicates to the browser that non-fullscreen playback is preferred when fullscreen playback is the native default, such as in iOS Safari.

For example:

videojs('my-player', {
  playsinline: true
});

plugins

Type: Object

This supports having plugins be initialized automatically with custom options when the player is initialized - rather than requiring you to initialize them manually.

videojs('my-player', {
  plugins: {
    foo: {bar: true},
    boo: {baz: false}
  }
});

The above is roughly equivalent to:

var player = videojs('my-player');

player.foo({bar: true});
player.boo({baz: false});

Although, since the plugins option is an object, the order of initialization is not guaranteed!

See the plugins guide for more information on Video.js plugins.

posterImage

Type: boolean, Defaut: true

Setting this to false removes Video.js's poster element.

preferFullWindow

Type: boolean, Defaut: false

Setting this to true will change fullscreen behaviour on devices which do not support the HTML5 fullscreen API but do support fullscreen on the video element, i.e. iPhone. Instead of making the video fullscreen, the player will be stretched to fill the browser window.

responsive

Type: boolean, Default: false

Setting this option to true will cause the player to customize itself based on responsive breakpoints (see: breakpoints option).

When this option is false (the default), responsive breakpoints will be ignored.

Note this is about the responsiveness of the controls within the player, not responsive sizing of the player itself. For that, see fluid.

restoreEl

Type boolean or Element, Default: false

If set to true, a copy of the placeholder element will be made before the player is initalised. If the player is disposed, the copy is put back into the DOM in the player's place.

If set to an HTML Element, that element would replace the disposed player instead.

skipButtons

Type: Object

Since 8.2.0

skipButtons.forward

Type: number

Since 8.2.0

If specified, Video.js displays a control allowing the user to jump forward in a video by the specified number of seconds.

The following values are valid: 5 | 10 | 30

videojs('my-player', {
  controlBar: {
    skipButtons: {
      forward: 5
    }
  }
});

skipButtons.backward

Type: number

Since 8.2.0

If specified, Video.js displays a control allowing the user to jump back in a video by the specified number of seconds.

The following values are valid: 5 | 10 | 30

videojs('my-player', {
  controlBar: {
    skipButtons: {
      backward: 10
    }
  }
});

sources

Type: Array

An array of objects that mirror the native <video> element's capability to have a series of child <source> elements. This should be an array of objects with the src and type properties. For example:

videojs('my-player', {
  sources: [{
    src: '//path/to/video.mp4',
    type: 'video/mp4'
  }, {
    src: '//path/to/video.webm',
    type: 'video/webm'
  }]
});

Using <source> elements will have the same effect:

<video ...>
  <source src="//path/to/video.mp4" type="video/mp4">
  <source src="//path/to/video.webm" type="video/webm">
</video>

suppressNotSupportedError

Type: boolean

If set to true, then the no compatible source error will not be triggered immediately and instead will occur on the first user interaction. This is useful for Google's "mobile friendly" test tool, which can't play video but where you might not want to see an error displayed.

techCanOverridePoster

Type: boolean

Gives the possibility to techs to override the player's poster and integrate into the player's poster life-cycle. This can be useful when multiple techs are used and each has to set their own poster any time a new source is played.

techOrder

Type: Array, Default: ['html5']

Defines the order in which Video.js techs are preferred. By default, this means that the Html5 tech is preferred. Other registered techs will be added after this tech in the order in which they are registered.

userActions

Type: Object

userActions.click

Type: boolean|function

Controls how clicking on the player/tech operates. If set to false, clicking is disabled and will no longer cause the player to toggle between paused and playing. If controls are disabled with controls: false, this will not call the handler function.

videojs('my-player', {
  userActions: {
    click: false
  }
});

If undefined or set to true, clicking is enabled and toggles the player between paused and play. To override the default click handling, set userActions.click to a function which accepts a click event (in this example it will request Full Screen, the same as a userActions.doubleClick):

function myClickHandler(event) = {
  // `this` is the player in this context

  if (this.isFullscreen()) {
      this.exitFullscreen();
    } else {
      this.requestFullscreen();
    }
};

videojs('my-player', {
  userActions: {
    click: myClickHandler
  }
});

userActions.doubleClick

Type: boolean|function

Controls how double-clicking on the player/tech operates. If set to false, double-clicking is disabled. If undefined or set to true, double-clicking is enabled and toggles fullscreen mode. To override the default double-click handling, set userActions.doubleClick to a function which accepts a dblclick event:

function myDoubleClickHandler(event) = {
  // `this` is the player in this context

  this.pause();
};

videojs('my-player', {
  userActions: {
    doubleClick: myDoubleClickHandler
  }
});

userActions.hotkeys

Type: boolean|function|object

Controls how player-wide hotkeys operate. If set to false, or undefined, hotkeys are disabled. If set to true or an object (to allow definitions of fullscreenKey etc. below), hotkeys are enabled as described below. To override the default hotkey handling, set userActions.hotkeys to a function which accepts a keydown event. If controls are disabled with controls: false, this will not call the handler function.

var player = videojs('my-player', {
  userActions: {
    hotkeys: function(event) {
      // `this` is the player in this context

      // `x` key = pause
      if (event.which === 88) {
        this.pause();
      }
      // `y` key = play
      if (event.which === 89) {
        this.play();
      }
    }
  }
});

Default hotkey handling is:

KeyActionEnabled by
ftoggle fullscreenonly enabled if a Fullscreen button is present in the Control Bar
mtoggle mutealways enabled, even if no Control Bar is present
ktoggle play/pausealways enabled, even if no Control Bar is present
Spacetoggle play/pausealways enabled, even if no Control Bar is present

Hotkeys require player focus first. Note that the Space key activates controls such as buttons and menus if that control has keyboard focus. The other hotkeys work regardless of which control in the player has focus.

userActions.hotkeys.fullscreenKey

Type: function

Override the fullscreen key definition. If this is set, the function receives the keydown event; if the function returns true, then the fullscreen toggle action is performed.

var player = videojs('my-player', {
  userActions: {
    hotkeys: {
      muteKey: function(event) {
        // disable mute key
      },
      fullscreenKey: function(event) {
        // override fullscreen to trigger when pressing the v key
        return (event.which === 86);
      }
    }
  }
});

userActions.hotkeys.muteKey

Type: function

Override the mute key definition. If this is set, the function receives the keydown event; if the function returns true, then the mute toggle action is performed.

userActions.hotkeys.playPauseKey

Type: function

Override the play/pause key definition. If this is set, the function receives the keydown event; if the function returns true, then the play/pause toggle action is performed.

vtt.js

Type: string

Allows overriding the default URL to vtt.js, which may be loaded asynchronously to polyfill support for WebVTT.

This option will be used in the "novtt" build of Video.js (i.e. video.novtt.js). Otherwise, vtt.js is bundled with Video.js.

Spatial Navigation

spatialNavigation

Type: Object Default: {enabled: false, horizontalSeek: false}

This option configures the Spatial Navigation within the Video.js player, enhancing accessibility and user experience on devices like smart TVs, where navigation through remote control is common.

Properties

  • enabled Type: boolean Default: false If set to true, enables the Spatial Navigation system in the player, allowing users to navigate through focusable components using the arrow keys on their remote control.

  • horizontalSeek Type: boolean Default: false When enabled, this allows users to use the left and right arrow keys for seeking through the video timeline, enhancing the navigation experience.

Usage

To enable Spatial Navigation with the default settings:

var player = videojs('my-player', {
  spatialNavigation: {
    enabled: true
  }
});

To enable Spatial Navigation with horizontal seeking:

var player = videojs('my-player', {
  spatialNavigation: {
    enabled: true,
    horizontalSeek: true
  }
});

Component Options

The Video.js player is a component. Like all components, you can define what children it includes, what order they appear in, and what options are passed to them.

This is meant to be a quick reference; so, for more detailed information on components in Video.js, check out the components guide.

children

Type: Array|Object

If an Array - which is the default - this is used to determine which children (by component name) and in which order they are created on a player (or other component):

// The following code creates a player with ONLY bigPlayButton and
// controlBar child components.
videojs('my-player', {
  children: [
    'bigPlayButton',
    'controlBar'
  ]
});

The children options can also be passed as an Object. In this case, it is used to provide options for any/all children, including disabling them with false:

// This player's ONLY child will be the controlBar. Clearly, this is not the
// ideal method for disabling a grandchild!
videojs('my-player', {
  children: {
    controlBar: {
      fullscreenToggle: false
    }
  }
});

${componentName}

Type: Object

Components can be given custom options via the lower-camel-case variant of the component name (e.g. controlBar for ControlBar). These can be nested in a representation of grandchild relationships. For example, to disable the fullscreen control:

videojs('my-player', {
  controlBar: {
    fullscreenToggle: false
  }
});

Tech Options

${techName}

Type: Object

Video.js playback technologies (i.e. "techs") can be given custom options as part of the options passed to the videojs function. They should be passed under the lower-case variant of the tech name (e.g. "html5").

html5

nativeControlsForTouch

Type: boolean

Only supported by the Html5 tech, this option can be set to true to force native controls for touch devices.

nativeAudioTracks

Type: boolean

Can be set to false to disable native audio track support. Most commonly used with videojs-contrib-hls.

nativeTextTracks

Type: boolean

Can be set to false to force emulation of text tracks instead of native support. The nativeCaptions option also exists, but is simply an alias to nativeTextTracks.

nativeVideoTracks

Type: boolean

Can be set to false to disable native video track support. Most commonly used with videojs-contrib-hls.

preloadTextTracks

Type: boolean

Can be set to false to delay loading of non-active text tracks until use. This can cause a short delay when switching captions during which there may be missing captions.

The default behavior is to preload all text tracks.

包含是什么意思 胃寒湿气重吃什么药效果最好 乌龟都吃什么 口腔溃疡喝什么 祛湿吃什么食物
absorb什么意思 焦虑症看什么科 心口疼是什么原因引起的 女人味是什么 梦见眼镜蛇是什么预兆
什么原因导致卵巢早衰 绿茶不能和什么一起吃 左侧附件区囊性占位是什么意思 旋转跳跃我闭着眼是什么歌 夏天吃什么水果比较好
头发干枯毛躁是什么原因 中国第一个不平等条约是什么 恋童癖是什么意思 什么叫快闪 等着我为什么停播了
羸弱是什么意思hcv8jop3ns1r.cn leu是什么氨基酸hcv8jop0ns6r.cn 新生儿痤疮是什么引起的xjhesheng.com 南昌有什么好玩的景点hcv9jop0ns0r.cn 珍珠鸟吃什么hcv8jop7ns3r.cn
心仪的人是什么意思hcv9jop4ns7r.cn 五险一金是指什么mmeoe.com 277是什么意思hcv9jop6ns3r.cn mect是什么意思hcv7jop9ns6r.cn 1968属什么hcv8jop0ns5r.cn
暗经是什么意思cl108k.com 不带壳的蜗牛叫什么youbangsi.com 中性粒细胞绝对值偏高是什么原因hcv9jop3ns3r.cn 阴道有腥臭味用什么药hcv9jop0ns7r.cn 麒麟臂什么意思dajiketang.com
义眼是什么hcv9jop6ns4r.cn honor是什么牌子aiwuzhiyu.com 皮肤过敏用什么药hcv8jop4ns3r.cn 1926年属什么生肖hcv8jop8ns5r.cn 嗓子疼吃什么水果hcv8jop1ns3r.cn
百度