在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
Smartideo插件使用方法
你可以直接粘贴视频播放也完整的URL到编辑器(单独一行),就可以加载视频播放器。
URL地址格式如下
http://v.youku.com/v_show/id_XMTYzNTgxNTMy.html
http://www.tudou.com/programs/view/YBdHhxJqrLY/
http://www.56.com/u35/v_MTEwMjM5NDcy.html
http://v.qq.com/page/o/9/f/o0142tt1m9f.html
http://v.qq.com/cover/t/tyeqdw6rof7t5ow/p0015kjlai9.html
http://my.tv.sohu.com/us/94469256/77228432.shtml
http://www.wasu.cn/Play/show/id/5079941
http://v.yinyuetai.com/video/2207109
http://v.ku6.com/show/P0Ib_pTne6-FBSa1AbtKUQ...html
http://www.letv.com/ptv/vplay/20932037.html
WordPress视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

或者上传文件夹smartideo至/wp-content/plugins/目录.
在插件管理页面中激活Smartideo.

<?php
/*
PluginName:Smartideo
PluginURI:http://www.fengziliu.com/
Description:Smartideo是为WordPress添加对在线视频支持的一款插件(支持手机、平板等设备HTML5播放)。目前支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等网站。
Version:1.2
Author:FensLiu
AuthorURI:http://www.fengziliu.com/smartideo-for-wordpress.html
*/
define('SMARTIDEO_VERSION','1.0');
define('SMARTIDEO_URL',plugins_url('',__FILE__));
define('SMARTIDEO_PATH',dirname(__FILE__));
$smartideo=newsmartideo();
classsmartideo{
private$width='100%';
private$height='500';
private$mobile_width='100%';
private$mobile_height='250';
publicfunction__construct(){
if(is_admin()){
add_action('admin_menu',array($this,'admin_menu'));
}
$option=get_option('smartideo_option');
if(!empty($option)){
$option=json_decode($option,true);
}else{
$option=array();
}
extract($option);
if(!empty($width)){
$this->width=$width;
}
if(!empty($height)){
$this->height=$height;
}
if(!empty($mobile_width)){
$this->mobile_width=$mobile_width;
}
if(!empty($mobile_height)){
$this->mobile_height=$mobile_height;
}
wp_embed_register_handler('smartideo_tudou',
'#https?://(?:www.)?tudou.com/(?:programs/view|listplay/(?<list_id>[a-z0-9_=-]+))/(?<video_id>[a-z0-9_=-]+)#i',
array($this,'smartideo_embed_handler_tudou'));
wp_embed_register_handler('smartideo_56',
'#https?://(?:www.)?56.com/[a-z0-9]+/(?:play_album-aid-[0-9]+_vid-(?<video_id1>[a-z0-9_=-]+)|v_(?<video_id2>[a-z0-9_=-]+))#i',
array($this,'smartideo_embed_handler_56'));
wp_embed_register_handler('smartideo_youku',
'#https?://v.youku.com/v_show/id_(?<video_id>[a-z0-9_=-]+)#i',
array($this,'smartideo_embed_handler_youku'));
wp_embed_register_handler('smartideo_qq',
'#https?://v.qq.com/(?:cover/g/[a-z0-9_.]+?vid=(?<video_id1>[a-z0-9_=-]+)|(?:[a-z0-9/]+)/(?<video_id2>[a-z0-9_=-]+))#i',
array($this,'smartideo_embed_handler_qq'));
wp_embed_register_handler('smartideo_sohu',
'#https?://my.tv.sohu.com/us/(?:d+)/(?<video_id>d+)#i',
array($this,'smartideo_embed_handler_sohu'));
wp_embed_register_handler('smartideo_wasu',
'#https?://www.wasu.cn/play/show/id/(?<video_id>d+)#i',
array($this,'smartideo_embed_handler_wasu'));
wp_embed_register_handler('smartideo_yinyuetai',
'#https?://v.yinyuetai.com/video/(?<video_id>d+)#i',
array($this,'smartideo_embed_handler_yinyuetai'));
wp_embed_register_handler('smartideo_ku6',
'#https?://v.ku6.com/show/(?<video_id>[a-z0-9-_.]+).html#i',
array($this,'smartideo_embed_handler_ku6'));
wp_embed_register_handler('smartideo_letv',
'#https?://www.letv.com/ptv/vplay/(?<video_id>d+)#i',
array($this,'smartideo_embed_handler_letv'));
}
publicfunctionsmartideo_embed_handler_tudou($matches,$attr,$url,$rawattr){
if(wp_is_mobile()){
$embed=$this->get_iframe("http://www.tudou.com/programs/view/html5embed.action?type=0&code={$matches['video_id']}");
}else{
$embed=$this->get_embed("http://www.tudou.com/v/{$matches['video_id']}/&resourceId=0_05_05_99&bid=05/v.swf");
}
returnapply_filters('embed_tudou',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_56($matches,$attr,$url,$rawattr){
$matches['video_id']=$matches['video_id1']==''?$matches['video_id2']:$matches['video_id1'];
if(wp_is_mobile()){
$embed=$this->get_iframe("http://www.56.com/iframe/{$matches['video_id']}");
}else{
$embed=$this->get_embed("http://player.56.com/v_{$matches['video_id']}.swf");
}
returnapply_filters('embed_56',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_youku($matches,$attr,$url,$rawattr){
if(wp_is_mobile()){
$embed=$this->get_iframe("http://player.youku.com/embed/{$matches['video_id']}");
}else{
$embed=$this->get_embed("http://player.youku.com/player.php/sid/{$matches['video_id']}/v.swf");
}
returnapply_filters('embed_youku',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_qq($matches,$attr,$url,$rawattr){
$matches['video_id']=$matches['video_id1']==''?$matches['video_id2']:$matches['video_id1'];
if(wp_is_mobile()){
$embed=$this->get_iframe("http://v.qq.com/iframe/player.html?vid={$matches['video_id']}");
}else{
$embed=$this->get_embed("http://static.video.qq.com/TPout.swf?vid={$matches['video_id']}");
}
returnapply_filters('embed_qq',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_sohu($matches,$attr,$url,$rawattr){
if(wp_is_mobile()){
$embed=$this->get_iframe("http://tv.sohu.com/upload/static/share/share_play.html#{$matches['video_id']}_0_0_9001_0");
}else{
$embed=$this->get_embed("http://share.vrs.sohu.com/my/v.swf&topBar=1&id={$matches['video_id']}&autoplay=false&xuid=&from=page");
}
returnapply_filters('embed_sohu',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_wasu($matches,$attr,$url,$rawattr){
if(wp_is_mobile()){
$embed=$this->get_iframe("http://www.wasu.cn/Play/iframe/id/{$matches['video_id']}");
}else{
$embed=$this->get_embed("http://s.wasu.cn/portal/player/20141216/WsPlayer.swf?mode=3&vid={$matches['video_id']}&auto=0&ad=4228");
}
returnapply_filters('embed_wasu',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_yinyuetai($matches,$attr,$url,$rawattr){
$embed=$this->get_embed("http://player.yinyuetai.com/video/player/{$matches['video_id']}/v_0.swf");
returnapply_filters('embed_yinyuetai',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_ku6($matches,$attr,$url,$rawattr){
$embed=$this->get_embed("http://player.ku6.com/refer/{$matches['video_id']}/v.swf");
returnapply_filters('embed_ku6',$embed,$matches,$attr,$url,$rawattr);
}
publicfunctionsmartideo_embed_handler_letv($matches,$attr,$url,$rawattr){
$embed=$this->get_embed("http://i7.imgs.letv.com/player/swfPlayer.swf?id={$matches['video_id']}&autoplay=0");
returnapply_filters('embed_letv',$embed,$matches,$attr,$url,$rawattr);
}
privatefunctionget_embed($url){
$embed=sprintf(
'<embedsrc="%1$s"allowFullScreen="true"quality="high"width="%2$s"height="%3$s"allowScriptAccess="always"type="application/x-shockwave-flash"></embed>',
$url,$this->width,$this->height);
return$embed;
}
privatefunctionget_iframe($url){
$iframe=sprintf(
'<iframesrc="%1$s"width="%2$s"height="%3$s"frameborder="0"allowfullscreen="true"></iframe>',
$url,$this->mobile_width,$this->mobile_height);
return$iframe;
}
publicfunctionadmin_menu(){
add_plugins_page('Smartideo设置','Smartideo设置','manage_options','smartideo_settings',array($this,'admin_settings'));
}
publicfunctionadmin_settings(){
if($_POST['smartideo_submit']=='保存'){
$param=array('width','height','mobile_width','mobile_height');
$json=array();
foreach($_POSTas$key=>$val){
if(in_array($key,$param)){
$json[$key]=$val;
}
}
$json=json_encode($json);
update_option('smartideo_option',$json);
}
$option=get_option('smartideo_option');
if(!empty($option)){
$option=json_decode($option,true);
}
if(empty($option['width'])){
$option['width']='100%';
}
if(empty($option['height'])){
$option['height']='500';
}
if(empty($option['mobile_width'])){
$option['mobile_width']='100%';
}
if(empty($option['mobile_height'])){
$option['mobile_height']='250';
}
echo'<h2>Smartideo设置</h2>';
echo'<formaction=""method="post">
<tableclass="form-table">
<trvalign="top">
<thscope="row">播放器宽度</th>
<td>
<label><inputtype="text"class="regular-textcode"name="width"value="'.$option['width'].'"></label>
<br/>
<pclass="description">默认宽度为100%</p>
</td>
</tr>
<trvalign="top">
<thscope="row">播放器高度</th>
<td>
<label><inputtype="text"class="regular-textcode"name="height"value="'.$option['height'].'"></label>
<br/>
<pclass="description">默认高度为500px</p>
</td>
</tr>
<trvalign="top">
<thscope="row">移动设备播放器宽度</th>
<td>
<label><inputtype="text"class="regular-textcode"name="mobile_width"value="'.$option['mobile_width'].'"></label>
<br/>
<pclass="description">手机、平板等设备访问时,默认宽度为100%</p>
</td>
</tr>
<trvalign="top">
<thscope="row">移动设备播放器高度</th>
<td>
<label><inputtype="text"class="regular-textcode"name="mobile_height"value="'.$option['mobile_height'].'"></label>
<br/>
<pclass="description">手机、平板等设备访问时,默认高度为250px</p>
</td>
</tr>
</table>
<pclass="submit"><inputtype="submit"name="smartideo_submit"id="submit"class="button-primary"value="保存"></p>
</form>';
}
}
[WordPress插件怎样安装WordPress插件安装方法]行星吞噬进化免广告版下载-行星吞噬进化免广告版1.0.1 安卓版
展开内容
hoyolab社区app下载-原神国际版hoyolab社区3.6.0 安卓最新版
LUXAR游戏-LUXAR pc免费版正式版
销售管理软件免费版-智络店铺收银系统6.9.0.8 官方最新版
生化围城1.5.6.0正式版地图下载-生化围城V1.5.60 正式版【附攻略】
动漫桌面壁纸-高清动漫电脑桌面壁纸精选免费版
友情连接监控系统V1.0 绿色免费版
文字转语音手机版-文字转语音引擎(google文字转语音)3.7.12.2235583.arm.arm_neon 最新版
灵剑仙缘苹果版下载-灵剑仙缘ios版1.0iPhone版
尚合教育app下载-尚合教育app1.0.8 安卓版
二之国交错世界国服官方下载-二之国交错世界国服1.0.186 腾讯版
百炼成仙1.5.8局域网版【附攻略】
魔力涂鸦下载-魔力涂鸦游戏1.0 AR版
FreeFire下载安卓版-自由开火Free Fire游戏1.102.1 官方版
局域网共享绿化版2.0 绿色免费版
巫师2修改器下载-巫师2七项属性修改器+7v3.10 steam版
三国战争手游下载最新版-三国战争手游安卓版25.683 官方版
驱动精灵极速装机版2015-驱动精灵极速装机版2.0 Beta 官方完整版
弑魔修仙传3.4隐藏英雄密码-弑魔修仙传3.4正式版【附攻略+隐藏英雄密码】
今日半价官网版下载-今日半价(手机购物)4.6.0安卓最新版
Autodesk Alias Design 2014 mac版官方免费版
免费网络防火墙软件下载-免费网络防火墙软件1.2.109官方版
小猴萌奇识字下载-小猴萌奇识字儿童认字早教版 2.4 免费版
幽灵岛(Funwy Island)1.0 安卓版
简约平静优雅商务风个人简历ppt模板免费版
和爸爸一起散步ppt-和爸爸一起散步绘本故事下载免费版【亲情绘本故事】
滑雪大冒险十周年下载-滑雪大冒险十周年版本2.1.6 国际服
8.1/63.7M
SkiSafari跑酷休闲小游戏,这游戏也算是刚刚有智能电话的时候,玩过的游戏之一。当时很多人很喜欢玩。玩的是中国版本。现在这个版本是最新的版本,也是添加很多中...
git 托管服务-Go 写的 git 托管服务(gogs)0.56 绿色版
8.8/435.8M
Gogs(GoGitService)是一个由Go语言编写的自助Git托管服务。Gogs完全使用Go语言来实现对Git数据的操作,实现零依赖,并且支持Go语言所支...
9.9/1,207.1M
本软件是一款荧光黑色鼠标指针文件,它色泽光滑,形状多态,荧光和黑色搭配,让您的鼠标指针更加个性,很炫哦。适合搭配多种主题。欢迎广大朋友免费下载使用!...
DWG Trueview 2018 64位官方下载-Autodesk DWG Trueview 2018 64位官方完整版
8.8/267.3M
AutodeskDWGTrueview2018是Autodesk公司打造的一款CAD图纸查看软件,支持DWG、DWF和DXF文件查看,查看DWG文件或将其转换为...
2017秦时明月蜃楼东渡版本下载-秦时明月手游十周年庆典版6.8.6官方安卓版
8.5/503.8M
秦时明月手游到2017年已经有十年了,可以说是非常经典的手游了,喜欢玩的人也是非常的多,想知道这次十周年的版本都是有什么更新的话,现在就可以来免费的下载秦时明月...
7.8/1,172.4M
超级看图软件极速版是一款全新的智能看图软件,该软件支持全屏、半屏图像预览,还有记录功能,上次看过图片记录被误关闭也能轻松还原。有需要可在东坡下载。超级看图软件简...
8.4/1,481.1M
鑫少荣耀盒子,一款很好用的手机工具箱软件,具有游戏专区美化、vip专区、影视专区等功能,还拥有你们最期待的qq辅助功能和王者荣耀美化功能。鑫少荣耀盒子功能游戏专...
advanced codecs for win7/8/108.3.6 免费正版
8.0/1,020.3M
advancedcodecsforwin7/8/10,是一套专用于Windows7上面的解码包(XP/2003系统也适用),以确保它们可以播放多种多媒体文件,而...
青3创4表情包高清版下载-青3创4表情包无水印版1.0免费版
7.6/1,887.4M
青3创4表情包高清无水印版,每一次选秀节目都会吸引大家的注意力,在这里为大家整理最全的青3创4里面人物的表情包,各位伙伴们,赶紧来下载吧!看看有没有你喜欢的人的...
9.4/97.8M
精灵五笔输入法是一款基于王码五笔86版输入方案并使用多多输入法生成器精心制作而成的一款五笔输入软件。本软件完美支持Win8及Metro界面,支持五笔、拼音、五笔...
8.7/1,672.3M
一个非常简单好用的表情包P图软件,用户们能够使用这款软件亲手制作自己的专属表情包,这里拥有海量的表情包素材,你可以将这些素材自由地组合在一起,形成一个全新的表情...
元梦之星领6元红包下载-元梦之星红包版1.2.66.1 免费领Q币
7.7/279.2M
相信最近关注《元梦之星》这款游戏的玩家都知道游戏官方为了吸引玩家,不仅仅是送礼包福利,还有送皮肤!送Q币!甚至是新用户上线就可以领取红包!真实到账,亲测是有效的...
无忧写作APP下载安装官方版-无忧写作AI软件1.0.0 最新版
8.9/1,693.7M
无忧写作APP其实是款比较好用的AI写作软件,软件可以帮助用户更叫高效的进行文字创作。无论你需要撰写一篇专业的学术论文、一篇引人入胜的小说,还是一篇简洁明了的商...
全能扫描博士app下载-全能扫描博士app1.0.0 安卓版
9.4/1,798.0M
全能扫描博士app是一款好用的办公软件,可以帮助你快速扫描文档,识别文字,生存电子文档,并且可以转换为你需要的文档格式,简单好用,欢迎来下载!全能扫描博士app...
7.5/986.8M
在上个月底就公布的周杰伦新歌前世情人mv后,马上就获得了非常高的点击量,就在昨天又发行了它的整张专辑——周杰伦床边的故事,小编这时带来了周杰伦最新专辑的主打歌—...
ps2017绿色版下载-Photoshop CC 2017 绿色精简版18.1.1.252 免费版
9.8/620.6M
PhotoshopCC18.1.1.252最新版是2017年最新绿色版便携精简版,下载后解压就可以使用,绿色免安装,已破解免激活,自带大量的组件,非常好用,欢迎...
儿童教育游戏大全集下载-儿童教育游戏大全免费版2.2 最新版
8.8/1,241.4M
增长宝宝的知识发展宝宝的智力,儿童教育游戏大全提供了拼音、汉字、动物等内容,生动的卡通图片,让孩子去认识学习。儿童教育游戏大全免费版介绍儿童教育游戏大全是一款全...
查找软件安装目录工具(AppPaths 2000)v3.1绿色版
9.2/1,051.0M
现在很多人安装各种软件或者游戏都是不停的点击下一步,导致安装完以后不知道软件安装到哪个文件夹里了。这里给大家推荐一款很好用的软件安装目录查找工具。AppPath...
9.4/922.3M
中维云视通网络监控系统是中维世纪最新出炉的一个远程监控系统,安装在了多个设备上面,通过电脑查看摄像头内容,非常方便,专业级别监控系统!中维云视通网络监控系统介绍...
部落战线国际服下载-部落战线下载(Clash Quest)0.441.141 最新版
7.8/453.9M
《部落战线(ClashQuest)》为Supercell最新公布的回合制战术冒险策略游戏,游戏整体机制为:开始有着固定的兵种和数量,当你提前耗尽所有的兵种数量还...
8.1/944.8M
网络人(Netman)是一款超级简单、安全的远程控制软件。支持远程开机、关机,监控对方电脑屏幕,遥控鼠标键盘,监控摄像头(可将监控内容录象),远程管理文件,并可...
普及防疫知识弘扬抗疫精神观后感-开学第一课普及防疫知识弘扬抗疫精神作文完整版【800字+600字+300字+400字】
9.6/569.0M
这是关于2020年9月1日开学第一课的内容的读后感,很多学校都会要求学生进行统一观看,然后写一篇读后感作文来谈谈自己对于这次的主题的感想,小编整理一些内容分享!...
9.3/202.6M
生化危机5黄金版八项修改器为中文版,直接免去了看英文对照修改的问题,简单易用。该修改器包含了无限血、一击必杀、无限金钱、车辆无限生命等八项功能,帮助你轻松闯关,...
智慧商贸进销存免费版下载-智慧商贸进销存免费版9.9.1安卓最新版
9.4/1,649.9M
智慧商贸进销存免费版是一款针对门店的进销存管理软件,用户下载这款软件就能够在上面进行非常便捷的日常记账需求,app涵盖的功能非常丰富,并且免费没有广告,非常的强...
pr2021破解版下载-pr2021(Adobe Premiere Pro 2021 简体中文版)15.0 中文免费版
10.0/715.4M
PremierePro2021版本已经正式发布,简称:pr2021,相应的pr2021破解版本也已经被网络上的大神弄出来了!本站找到了pr2021破解版,特来和...