Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the function of Video playback by HTML5

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to achieve the video playback function of HTML5. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Hivideo is a html5-based video player that rewrites itself instead of the original playback control bar style of video. Support pause, playback progress control, sound control, full-screen playback. If you want to use hivideo on your mobile phone, you can also support landscape playback when playing full screen.

JPlayer: audio and video player based on HTML5/Flash

JPlayer is a completely free and open source (MIT) jQuery multimedia library plug-in written by JavaScript (now also a Zepto plug-in)

JPlayer allows you to quickly write a cross-platform web page that supports audio and video playback.

JPlayer's rich API allows you to create a personalized multimedia application, so it is also supported and encouraged by more and more community members.

Official website: www.jplayer.cn

English: www.jplayer.org

1. Prepare for

Jquery.min.js, jquery.jplayer.min.js, jquery.jplayer.swf (downloaded from the official website)

And an audio file.

two。 Code

Clear Ding Dong short tone play pause stop mute unmute max volume Function toplay () {var playerc = $("# jquery_jplayer_1") If (playerc.data (). JPlayer & & playerc.data (). JPlayer.internal.ready = true) {playerc.jPlayer ("setMedia", {M4a: "http://cdnringhlt.shoujiduoduo.com/ringres/user/a24/140/14972140.aac" / / use network resources, set your own audio file}) .jPlayer (" play ") / / jPlayer ("play") is used to automatically play} else {playerc.jPlayer ({ready: function () {$(this) .jPlayer ("setMedia") {M4a: "http://cdnringhlt.shoujiduoduo.com/ringres/user/a24/140/14972140.aac" / / Ibid}) .jPlayer (" play ") / / Ibid.}, swfPath: "include/javascript", supplied: "M4a" / / acc belongs to M4A});}} setInterval (function () {toplay ();}, 3000) / / the article on "how to achieve video playback in HTML5" is shared here in a 3-second loop. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report