Posted in Javascript onJanuary 11, 2017
本文实例讲述了jQuery插件JWPlayer视频播放器用法。分享给大家供大家参考,具体如下:
JWPlayer 插件播放视频播放器 使用方法:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html; charset=UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport"/> <meta content="telephone=no, address=no, email=no" name="format-detection"> <title>快讯视频预览</title> <style> .jwlogo{ display: none; } #container{ margin: auto; } #videoDiv{ margin-top: 30px; } </style> </head> <body> <section id="videoDiv"> <div id="container">Loading the player ...</div> </section> </body> <script type="text/javascript" src="/wamei/pages/js/jquery-1.11.3.min.js" ></script> <script type="text/javascript" src="/wamei/pages/js/jwplayer/jwplayer.js"></script> <script> $(function(){ var videoUrl = getUrlParam("videoUrl"); var videoCover = getUrlParam("videoCover"); if(videoUrl){ jwplayer("container").setup({ flashplayer : "/wamei/pages/js/jwplayer/player.swf", levels: [{file: videoUrl}], image: videoCover, height : 270, width : 480 }); } }); //获取url中的参数 function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return null; //返回参数值 } </script> </html>
希望本文所述对大家jQuery程序设计有所帮助。
jQuery插件JWPlayer视频播放器用法实例分析
- Author -
kenhins声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@