HTML5 implements parsing of players compatible with major browsers
This article mainly introduces HTML5 to achieve perfect compatibility with the players of major browsers. Friends who need it can refer to the
song playback. We will find that its compatibility is not very good. For example, it can be played on IE. The flash player for playback is not a good application on Firefox or Chrome because of the obstruction of plug-ins! The emergence of HTML5 has made all this possible, but although the player can play, we still need to pay attention to the user experience. degree, so we wrote an HTML-compatible player! It is backward compatible with IE6-9, chrome, firfox, opera and other mainstream players. It should be fully compatible! The implementation principle code is presented to everyone!
<!doctype html> <html> <head> <meta charset=utf-8> <title>歌词同步播放器-powered by widuu xiaowei</title> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.4"> <meta name="MobileOptimized" content="240"> <link href="/mp3/css/blue.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="/mp3/js/jquery.js"></script> <script type="text/javascript" src="/mp3/js/jquery.jplayer.js"></script> <script type="text/javascript" src="/mp3/js/lrc.js"></script> <style type="text/css"> * { margin:0; padding:0; } ul, ol, dl { list-style:none; } .content li.hover{ color:red; } .content{ width:402px; height:200px; background:#ccc; overflow:hidden; padding:10px;} </style> <script> //<![CDATA[ $(document).ready(function(){ $("#jquery_jplayer_1").jPlayer({ ready: function (event) { $(this).jPlayer("setMedia", { mp3:"yangcong.mp3" //mp3的播放地址 }).jPlayer("play"); }, timeupdate: function(event) { if(event.jPlayer.status.currentTime==0){ time = ""; }else { time = event.jPlayer.status.currentTime; } }, play: function(event) { //点击开始方法调用lrc。start歌词方法 返回时间time if(event.jPlayer.status.currentTime==0){ $("#jquery_jplayer_1").jPlayer("pause",1); } if($('#lrc_content').val()!==""){ $.lrc.start($('#lrc_content').val(), function() { return time; }); }else{ $(".content").html("没有字幕"); } }, repeat: function(event) { if(event.jPlayer.options.loop) { $(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function() { $(this).jPlayer("play"); }); } else { $(this).unbind(".jPlayerRepeat"); } }, swfPath: "/js", //存放jplayer.swf的决定路径 solution:"html, flash", //支持的页面 supplied: "mp3", //支持的音频的格式 wmode: "window" }); $("#lrc_content").hide(); }); //]]> </script> </head> <body> <textarea id="lrc_content" name="textfield" cols="70" rows="10"> [ar:测试用 ] [00:03.00]洋葱 [00:06.00]演唱:平安 [00:09.00] [00:11.38]如果你眼神能够为我片刻的降临 [00:21.23]如果你能听到心碎的声音 [00:28.88]盘底的洋葱像我永远是配角戏 [00:35.74]偷偷的看着你偷偷的隐藏着自己 [00:43.48] [00:44.90]如果你愿意一层一层 [00:48.46]一层的剥开我的心 [00:52.66]你会发现你会讶异 [00:56.40]你是我最压抑最深处的秘密 [01:00.26]如果你愿意一层一层 [01:03.69]一层的剥开我的心 [01:07.76]你会鼻酸你会流泪 [01:11.60]只要你能听到我看到我的全心全意 [01:18.30] [01:19.11]如果你愿意一层一层 [01:22.57]一层的剥开我的心 [01:26.66]你会发现你会讶异 [01:30.41]你是我最压抑最深处的秘密 [01:34.48]如果你愿意一层一层 [01:37.58]一层的剥开我的心 [01:41.51]你会鼻酸你会流泪 [01:45.15]只要你能听到我看到我的全心全意 [01:53.55] [01:55.65]你会鼻酸你会流泪 [01:59.84]只要你能听到我看到我的全心全意 [02:12.57] </textarea></p> <p><p> <p id="jquery_jplayer_1" class="jp-jplayer"></p> <p id="jp_container_1" class="jp-audio"> <p class="jp-type-single"> <p class="jp-gui jp-interface"> <ul class="jp-controls"> <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li> <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li> <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li> <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li> <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li> <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li> </ul> <p class="jp-progress"> <p class="jp-seek-bar"> <p class="jp-play-bar"></p> </p> </p> <p class="jp-volume-bar"> <p class="jp-volume-bar-value"></p> </p> <p class="jp-time-holder"> <p class="jp-current-time"></p> <p class="jp-duration"></p> <ul class="jp-toggles"> <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li> <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li> </ul> </p> </p> <p class="jp-title"> <ul> <li>mp3player powered by xiaowei</li> </ul> </p> <p class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="<a href="http://get.adobe.com/flashplayer/">http://get.adobe.com/flashplayer/</a>" target="_blank">Flash plugin</a>. </p> </p> </p> <p class="content"><ul id="lrc_list"> 点击开始播放…… </ul></p> </body> </html>
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
Using HTML5 to implement web music player
Solution to the problem that the video tag in html5 cannot play mp4 Method
The above is the detailed content of HTML5 implements parsing of players compatible with major browsers. For more information, please follow other related articles on the PHP Chinese website!

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.

There is no difference between HTML5 and H5, which is the abbreviation of HTML5. 1.HTML5 is the fifth version of HTML, which enhances the multimedia and interactive functions of web pages. 2.H5 is often used to refer to HTML5-based mobile web pages or applications, and is suitable for various mobile devices.

HTML5 is the latest version of the Hypertext Markup Language, standardized by W3C. HTML5 introduces new semantic tags, multimedia support and form enhancements, improving web structure, user experience and SEO effects. HTML5 introduces new semantic tags, such as, ,, etc., to make the web page structure clearer and the SEO effect better. HTML5 supports multimedia elements and no third-party plug-ins are required, improving user experience and loading speed. HTML5 enhances form functions and introduces new input types such as, etc., which improves user experience and form verification efficiency.

How to write clean and efficient HTML5 code? The answer is to avoid common mistakes by semanticizing tags, structured code, performance optimization and avoiding common mistakes. 1. Use semantic tags such as, etc. to improve code readability and SEO effect. 2. Keep the code structured and readable, using appropriate indentation and comments. 3. Optimize performance by reducing unnecessary tags, using CDN and compressing code. 4. Avoid common mistakes, such as the tag not closed, and ensure the validity of the code.

H5 improves web user experience with multimedia support, offline storage and performance optimization. 1) Multimedia support: H5 and elements simplify development and improve user experience. 2) Offline storage: WebStorage and IndexedDB allow offline use to improve the experience. 3) Performance optimization: WebWorkers and elements optimize performance to reduce bandwidth consumption.

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!
