Development of Web front-end HTML5 live broadcasting function

Source: Internet
Author: User
Tags event listener
One, video.js video playback

Github:https://github.com/videojs/video.js

Base code:

<script src= "Https://unpkg.com/video.js/dist/video.js" ></script>
<video
		id= "My-player"
		class= "Video-js vjs-default-skin vjs-big-play-centered" Controls
		preload= "Auto" x5-playsinline= "playsinline=" "webkit-playsinline=" "poster=" "data-setup=" "Example_option
		": True} ' >
</video>
	var player = Videojs (' My-player ', options, function Onplayerready () {
		videojs.log (' Your player is ready! ');

		In the, "This" is the player of that being created by Video.js.
		This.play ();

		How about an event listener?
		This.on (' Ended ', function () {
			videojs.log (' Awww...over so soon?! ');
		});
	



Turn on AutoPlay (support for Android, IOS, PC):

<video
      id= "My-player"
      class= "Video-js vjs-default-skin vjs-big-play-centered" Controls
      preload= "Auto"
      x5-playsinline= "playsinline=" "webkit-playsinline=" "poster=" "data-setup=" "Example_"
      Option ": true} ' >


Second, Videojs-contrib-hls live function

Github:https://github.com/videojs/videojs-contrib-hls

<script src= "Https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js" ></script>

Android, iOS need to m3u8 format live address

WebKit and other PC browsers need Videojs-flash support playback TRMP


Third, Videojs-flash Chrome and other browser-assisted

Github:https://github.com/videojs/videojs-flash

<script src= "Https://unpkg.com/videojs-flash/dist/videojs-flash.js" ></script>

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.