1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00
video.js/docs/guides/faq.md
2017-02-12 11:39:31 -05:00

14 KiB

FAQ

Table of Contents

Q: What is video.js?

video.js is an extendable framework/library around the native video element. It does the following:

  • Offers a plugin API so that different types of video can be handed to the native video element (e.g. HLS, Flash, HTML5 video, etc).
  • Unifies the native video api across browsers (polyfilling support for features if necessary)
  • Offers an extendable and themable UI
  • Takes care of accessibility for the user (in-progress)
  • Has a set of core plugins that offer support for tons of additional video formats.
  • Support for DRM video via a core plugin
  • Lots of plugins which offer support for all kinds of features. See the plugin list on videojs.com

Q: How do I install video.js?

Currently video.js can be installed using bower, npm, serving a release file from a github tag, or even using a CDN hosted version. For information on doing any of those see the install guide.

Q: Is video.js on bower?

Yes! See the install guide for more information.

Q: What do video.js version numbers mean?

video.js follows semver which means that the API should not change out from under a user unless there is a major version increase.

Q: How can I troubleshoot playback issues?

See the troubleshooting guide. If troubleshooting does not solve your issue, please submit a pull request or an issue.

Q: A video does not play in a specific browser. Why?

See the troubleshooting guide. If troubleshooting does not solve your issue, please submit a pull request or an issue.

Q: Why does the entire video download before playback? Why does the video load for a long time?

See the troubleshooting guide. If troubleshooting does not solve your issue, please submit a pull request or an issue.

Q: I see an error thrown that mentions vdata12345. What is that?

See the troubleshooting guide. If troubleshooting does not solve your issue, please submit a pull request or an issue.

Q: I think I found a bug with video.js or I want to add a feature. What should I do?

if you think that you can fix the issue or add the feature

Submit a pull request to the video.js repo. Make sure to follow the contributing guide and the pull request template.

If you don't think you can fix the issue or add the feature

Open an issue on the video.js repo. Make sure that you follow the issue template and the contributing guide so that we can better assist you with your issue.

Q: What is a reduced test case?

A reduced test case is an example of the problem that you are facing in isolation. Think of it as example page that reproduces the issue in the least amount of possible code. We have a starter example for reduced test cases. To learn more about reduced test cases visit css-tricks

Q: What media formats does video.js support?

This depends on the formats supported by the browser's HTML5 video element, and the playback techs made available to video.js. For example, video.js 5 includes the Flash tech by default which enables the playback of FLV video where the Flash plugin is available. For more information on media formats see the troubleshooting guide.

Q: How to I autoplay the video?

Video.js supports the standard html5 autoplay attribute on the video element. It also supports it as an option to video.js or as a method invocation on the player.

<video autoplay controls class="video-js">
var player = videojs('my-video', {
  autoplay: true
});

// or

player.autoplay(true);

Q: How can I autoplay a video on a mobile device?

Most mobile devices have blocked autoplaying videos until recently. For mobile devices that don't support autoplaying, autoplay isn't supported by video.js. For those devices that support autoplaying, like iOS10 and Chrome for Android 53+, you must mute the video or have a video without audio tracks to be able to play it. For example:

<video muted autoplay playsinline>

Will make an inline, muted, autoplaying video on an iPhone with iOS10.

Q: How can I play RTMP video in video.js?

Make sure that the Flash tech is available -- RTMP is not playable on browsers without Flash including mobile. Then, just set the rtmp source with an appropriate type -- rtmp/mp4 or rtmp/flv. The main thing to be aware of is that video.js splits the connection url and stream name with the & character. So, you'd want to update the url to follow that format. For example: rtmp://example.com/live&foo or rtmp://example.com/fms&mp4:path/to/file.mp4.

If the server requires query parameters for authentication, these should be added to the connection part url, for example rtmp://example.com/live?token=1234&foo.

It's impossible to hide the network requests a browser makes and difficult to sufficiently obfuscate URLs in the source. Techniques such as token authentication may help but are outside of the scope of video.js.

For content that must be highly secure videojs-contrib-eme adds DRM support.

Q: Can I turn off video.js logging?

Yes! This can be achieved by adding the following code after including Video.js, but before creating any player(s):

videojs.log.level('off');

For more information, including which logging levels are available, check out the debugging guide.

Q: What is a plugin?

A plugin is a group of reusable functionality that can be re-used by others. For instance a plugin could add a button to video.js that makes the video replay 10 times in a row before it stops playback for good. If such a plugin existed and was published users could include it on their page to share that functionality.

Q: How do I make a plugin for video.js?

See the plugin guide for information on making a plugin for video.js.

Q: Where can I find a list of video.js plugins?

The official list of plugins on videojs.com.

Q: How can I get my plugin listed on the website?

Add the 'videojs-plugin' keyword to your array in package.json and publish your package to npm. If you use the plugin generator this will be done automatically for you. See the plugins guide for more information.

Q: Where can I find a list of video.js skins?

See the video.js github wiki.

Q: Does video.js work as an audio only player?

Yes! It can be used to play audio only files in a <video> or <audio> tag. The difference being that the <audio> tag will not have a blank display area and the <video> tag will. Note that audio only will not work with the Flash playback tech.

Q: Does video.js support audio tracks?

Yes! See the audio tracks guide for information on using audio tracks.

Q: Does video.js support video tracks?

The code for video tracks exists but it has not been tested. See the video tracks guide for more information on using video tracks.

Q: Does video.js support text tracks (captions, subtitles, etc)?

Yes! See the text tracks guide for information on using text tracks.

Q: Does video.js support HLS (HTTP Live streaming) video?

video.js supports HLS video if the native HTML5 element supports HLS (e.g. Safari, Edge, Chrome for Android, and iOS). For browsers without native support see the videojs-contrib-hls project which adds support.

Q: Does video.js support MPEG Dash video?

video.js itself does not support MPEG DASH, however an official project called videojs-contrib-dash adds support for MPEG DASH video.

Q: Does video.js support live video?

Yes! Video.js adds support for live videos via the Flash tech which supports RTMP streams. The official HLS tech, videojs-contrib-hls, will add support for live HLS video if you add it to your page with video.js.

Q: Can video.js wrap around YouTube videos?

No. There is an official plugin that adds support. It is called videojs-youtube.

Q: Can video.js wrap around Vimeo videos?

No. There is an official plugin that adds support. It is called videojs-vimeo.

Q: Does video.js support DRM video?

No. There is an official plugin that adds support. It is called videojs-contrib-eme.

Q: Does video.js have any support for advertisement integrations?

No. There is an official plugin that adds support. It is called videojs-contrib-ads.

Q: Can video.js be required in node.js?

Yes! Please submit an issue or open a pull request if this does not work.

Q: Does video.js work with webpack?

Yes! Please submit an issue or open a pull request if this does not work.

Be sure to use require('!style-loader!css-loader!video.js/dist/video-js.css') to inject video.js CSS.

Q: Does video.js work with react?

Yes! See ReactJS integration example.