在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
WordPress视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

[WordPress插件怎样安装WordPress插件安装方法]一览阅读app下载-一览阅读app1.3 安卓版【个性资讯平台】
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
<?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>';
}
}
展开内容
突围忍者手游下载-突围忍者手游1.3安卓版
子弹侠3D手游下载-Bullet Man子弹侠3D安卓版1.0.2 安卓最新版
房屋租赁合同书-个人房屋租赁合同书样本pdf格式【免费实用版】
魔界仙侠传鬼服手游下载-魔界仙侠传鬼服0.1折1.0 最新版
吃鱼大作战游戏下载-吃鱼大作战官方版3.7.2 手机版
我乐艺app2.1.14 安卓版
劳动力管理app下载-劳动力管理app4.8.2 安卓版
探我元宇宙下载-探我元宇宙app2.0.5 安卓版
淘宝京东天猫全能抢购神器安卓版下载-自制DIY全能抢购神器开源软件20201221最新版
小星医生医生版1.0.37安卓版
金华市民卡ios版1.0.0官网苹果版
打住商户端app1.4 安卓最新版
侠影贴吧吧主投诉机(投诉吧主)v1.0 绿色免费版
一千克拉女王oppo版下载-一千克拉女王oppo手机版1.1.6福利版
抄表猫管理端app-抄表猫管理端app1.2.9 智能版
7.8/1,900.7M
免费小说阅读搜索工具,搜书帝app是破解版本,帮助用户解决不能继续阅读之后的内容,海量的书库,优质的内容,种类繁多,分类非常的细,你想看的书籍基本上都能找到。搜...
rhx简易版app下载-rhx简易版不闪退安卓版6.0.15简易版
9.2/810.2M
rhx简易版不闪退安卓版是一款非常不错的手机控制服务软甲,手机出现闪退的情况这款软件能帮你,轻松设置LED显示屏的各种参数,例如控制区域,OE极性,数据极性和扫...
狂野城市飞车下载-Drift City-Hottest Racing Game(狂野城市飞车手游)1.1.2 安卓最新版
9.6/504.6M
这是一款非常刺激的赛车竞速手游,可玩性十分高,在这里掌握你的车技,不断地飙车,超越你的对手,你可以赚钱来升级你的赛车或者购买更好的车!游戏介绍《狂野城市飞车》是...
9.9/1,240.9M
麒麟通app是青岛森麒麟轮胎股份有限公司专为经销商和业务员打造的一个工作商务沟通、协同、智能化移动办公平台,app能够具满足用户所需要的办公功能,一站式的满足需...
聚应用4.0免登录下载-聚应用4.0免登录版v4.0 最新版
9.2/1,496.0M
聚应用4.0最新版本已经升级了,版本号更新,内容和界面升级,软件为应用营地。是一款功能齐全,内容丰富,各种板块都不断更新新资源,有用资源的平台,有云搜,有游戏,...
捷速图片文字转换成word软件-捷速图片文字转换成word软件1.1 免费版
9.6/482.6M
当你看到很多需要从图片里面复制与应用文字时,就可以用捷速图片文字转换成word软件,就能把图片文字批量转换来word里面,而且这样转换的速度也很快,让你可以正常...
9.5/1,357.5M
这是一款变态卡牌游戏,在无敌OL海量版里玩家将体验变态的玩法以及诸多福利的相送,三国的背景流畅的画质,让你在游戏中展开不一样的游戏经历!无敌OL海量版简介《无敌...
今日到期域名查询工具(当日到期优质域名查询)v1.0 绿色免费版
8.4/511.8M
今日到期域名查询工具可以帮你查询当日到期优质域名,可以检查域名是否可以注册,软件绿色免费,轻便小巧,使用方便快捷,非常实用。使用说明:打开工具后,可以选择1-4...
爱站seo工具官方下载-爱站工具包(爱站seo工具包)1.11.25.0 最新破解版
9.4/1,171.6M
对于弄网站的来说,总是会去爱站上面查询数据,这样弄的很烦闷,不过现在有爱站seo工具包,就能直接在在这个软件上进行操作,省去很多麻烦的步骤,而且这样的效率也得到...
冲顶大会竞答平台下载-冲顶大会答题软件1.0.2 最新版【邀请码】
9.4/1,352.8M
冲顶大会竞答平台,是一款全民答题软件,只要下载冲顶大会app,就可以参与到答题活动中来,闯关成功即可领取大奖,还有机会登上电视节目哦!国民老公王思聪制作冲顶指南...
7.6/1,728.3M
这是一款非常方便的考勤打卡助手软件,通过这个app你可以快速打卡服务,类似于钉钉的用法,还有更多的办公功能,帮助用户快速管理自己的工作信息等等!软件介绍企业系统...
dUP diablo2oo2s Universal Patcher v2.19 Final 补丁制作软件
9.3/1,858.4M
≡≡≡≡≡≡≡&am...
反恐精英射击游戏下载安装-反恐精英射击(King Of Emulator)3 安卓版
8.6/1,344.5M
反恐精英射击是一款第一人称枪战手游,游戏还原了反恐精英中很多元素,如武器、地图和玩法等,玩家可以在经典的地图中与敌人作战,秀出你的精准枪法,感兴趣的小伙伴快来u...
8.6/801.4M
斑马购物是一款省钱购物的购物平台,面对的客户大部分都是在华的外国人和跨境电商的买家,购物操作简单,价格实惠,商品质量优,有需要的朋友快来下载体验吧!斑马购物介绍...
8.4/1,935.0M
童话镇传奇是一本由作家李志伟所著的儿童文学作品,适合五六年级的小学生朋友阅读,作为精品课外读物推荐,小编带来了童话镇传奇读后感范文,可参考学习!作者简介李志伟,...
8.3/522.7M
最受00后欢迎的恋爱脱单神器,心动即可发起聊天,组成CP,扩列交友!这里有超多的00后的小姐姐小哥哥,不管是哪一种类型的这里全都有,找到你喜欢的那一款就是现在!...
9.7/766.5M
这是一款非常有趣的跳跃闯关类型游戏,很多玩家都在关注,游戏的关卡众多,你控制一个小球不断地跳跃然后躲避各种危险获得星星,经典的街机玩法!红球大冒险7中文版介绍一...
8.7/1,803.6M
思科防火墙是一款非常优秀的防火墙软件,可以帮助用户过滤哪些,病毒和有嫌疑的软件,需要的小伙伴快来东坡免费下载试试吧!功能介绍:重要的防火墙功能默认拒绝式保护确保...
9.0/882.0M
修真天下手游,是一款经典的家园文字游戏,游戏中的内容将会以文字和图片的形式描述,再现满满的情怀,而你需要通过各种选择来推动故事发展,感兴趣的朋友就来下载体验吧!...
8.6/1,934.5M
此修改器对应游戏超级街霸4:街机版任意版本,即所有版本通用,提供七项实用修改功能。使用时请关杀软,否则可能不能正常运行。基本功能点击简体、繁体、English,...
9.0/244.7M
荣安驾校app是专门为在荣安驾校学车的学员打造的一款软件,更够让学员更方便的进行课程预约,驾校也能够更方便的管理,及时的了解学员学车的情况。软件介绍荣安驾校AP...
马桶模拟器游戏下载手机版-马桶模拟器(Shit Simulator)1.0.3 正版
9.4/211.6M
马桶模拟器是一款沙雕模型模拟器手游,游戏玩起来非常搞笑,玩家将会在游戏中体验多个有趣的场景,玩法很丰富,总得来说越玩越开心,感兴趣的小伙伴快来uzzf东坡下载吧...
7.5/1,907.8M
欣欣自来水收费管理系统是一款专业的收费管理系统。该系统适用于大小供水公司或自来水厂以及物业管理部门。如果有这方面需求的你,那就快来下载使用吧!欣欣自来水收费管理...
天下人之野望官方正版手游-天下人之野望手游1.0.3 安卓版
9.6/1,800.9M
天下人之野望是一款战争题材的动作格斗游戏,玩家根据敌人的进攻情况制定合适的硬度策略,快速出击,保护自己的领域。还有丰富自由的游戏玩法,在游戏中完成各种经营模拟任...
7.7/984.7M
三国先锋逐鹿天下版是一款由经典三国题材改编来的策略游戏,这款游戏其实是18年就上线的三国游戏了,但是玩家热情依然不减,还是很受欢迎,游戏中玩家将来到三国时代,体...