本文實(shí)例講述了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>快訊視頻預(yù)覽</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中的參數(shù)function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //構(gòu)造一個(gè)含有目標(biāo)參數(shù)的正則表達(dá)式對(duì)象 var r = window.location.search.substr(1).match(reg); //匹配目標(biāo)參數(shù) if (r != null) return unescape(r[2]); return null; //返回參數(shù)值}</script></html>更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery常用插件及用法總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery切換特效與技巧總結(jié)》、《jQuery遍歷算法與技巧總結(jié)》、《jQuery常見(jiàn)經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注