Video playback plugin video.js simple to use

Source: Internet
Author: User

Plug - ins:

Video.js is a universal JS library embedded in the video player on the Web page, Video.js automatically detects the browser's support for HTML5, and uses the Flash player if HTML5 is not supported.

<%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Insert Title here</title><Linkhref= "Videojs/video-js.css"rel= "stylesheet"type= "Text/css"><Scriptsrc= "Videojs/video.js"></Script><Script>videojs.options.flash.swf= "video-js.swf";</Script></Head><Body><VideoID= "Example_video_1"class= "Video-js Vjs-default-skin"controls preload= "None"width= "640"Height= " the"Poster= "Musicsystemdata/mv/videopic/mvpic1.jpg"Data-setup="{}">    <Sourcesrc= "Musicsystemdata/mv/video/mv10.mp4"type= ' Video/mp4 '/>    < TrackKind= "captions"src= "DEMO.CAPTIONS.VTT"Srclang= "en"label= "中文版"></ Track><!--Tracks need an ending tag thanks to IE9 -    < TrackKind= "Subtitles"src= "DEMO.CAPTIONS.VTT"Srclang= "en"label= "中文版"></ Track><!--Tracks need an ending tag thanks to IE9 -</Video><Scripttype= "Text/javascript">    varMyplayer=Videojs ('Example_video_1'); Videojs ("Example_video_1"). Ready (function(){        varMyplayer=  This;    Myplayer.play (); });</Script></Body></HTML>
View Code

1. Referencing Video-js.cs style files and video.js in the page

<href= "Videojs/video-js.css"  rel= "stylesheet"  type = "Text/css" > <  src= "Videojs/video.js"></script>

2. Set the flash path, video.js will use Flash to play video files in a browser that does not support HTML5

< Script >  = "video-js.swf";      </ Script >

3. Set Playback initial diagram

Poster= "Musicsystemdata/mv/videopic/mvpic1.jpg"

4. Set the video path, you can use three video formats MP4, WEBM, OGG

<src= "Musicsystemdata/mv/video/mv10.mp4"  type/> 

5. Set the Enter page to play automatically

<Scripttype= "Text/javascript">    varMyplayer=Videojs ('Example_video_1'); Videojs ("Example_video_1"). Ready (function(){        varMyplayer=  This;    Myplayer.play (); });</Script>




Video playback plugin video.js simple to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.