您当前位置: 首页 美妆护肤 WordPress 视频插件-WordPress 视频插件(Smartideo)绿色免费版【附代码】

类型: 美妆护肤 版本: V2.2
大小: 1,411.6 时间: 2025-11-07





[WordPress插件怎样安装WordPress插件安装方法]
在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
<?php中公云学堂app1.1.0.0 安卓版
/*
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视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

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
战士超级大战游戏下载-战士超级大战最新版1.5官方版
29.9M
战士超级大战游戏是一款非常经典的街机格斗类游戏,里面有很多我们熟悉的英雄战士,特别是七龙珠里面的人物,大多数都能在这里找到,每一个英雄都有着自己的专属技能和动作...
倒计时器下载手机版-倒计时器app2.4.5.1 手机版
1,350.9M
倒计时器是一款简单易用的手机应用,专为帮用户管理时间、提醒重要事件而设计。无论是倒计时至特殊日子,还是设定定时提醒,它都能精准显示剩余时间,让你不错过任何关键时...
Libby图书馆APP下载安卓版-Libby图书馆1.1 最新版
1,413.3M
Libby图书馆APP是一款比较不错的听书读书软件,软件中能为用户提供大量的畅销好书,而且通过该软件用户能查阅到各种新书资源哦,其次这里能提供的书籍类型也是比较...
书虫英语app下载-书虫英语app手机版v6.4 安卓版
1,107.6M
书虫英语app手机版是一个学英语的软件,提供海量的英语学习资源,听说读写全面涵盖,软件功能完善,收录了大量优质英文阅读资料。书虫英语app介绍书虫英语是奉献给英...
蝌蚪音基app-蝌蚪音基学习类app1.2.7 中文正版
163.9M
蝌蚪音基是集音乐类资讯以及为学音乐孩子打下良好音乐基础为一体的学习类app,音基题库覆盖所有音乐基础知识点,支持各种版本教材的同步练习,丰富的题型支持,以及老师...
Bowling Club(保龄球俱乐部3D冠军手游)1.4安卓版
378.7M
一场刺激的保龄球pk赛即将开始,保龄球俱乐部3D冠军手游为你提供了真实的模拟环境,滑动屏幕控制保龄球的方向,击中所有的瓶子获得高分,成为保龄球高手!保龄球俱乐部...
点点削水果红包版下载-点点削水果382.101 安卓版
1,121.9M
点点削水果是一款消除赚钱手游,在游戏中玩家可以消除关卡中的所有水果,玩起来简单且解压,重要的是,游戏之中还有海量的想现金红包领取,全部都可以提现哦,感兴趣的小伙...
便当小能手下载-便当小能手游戏2.3 最新版
697.6M
谁懂啊!玩个做饭游戏被下蛊了,脑海全是美食。游戏名:便当小能手,宝子们将亲手制作可乐饼、炸鸡块、炸丸子等,并再挑选各种饭团、蛋糕、小吃、水果去搭配组装便当。玩法...
CIAYO故事(CIAYO Stories)1.0.1 安卓版
1,897.2M
游戏厂商AgateGames根据视觉小说改编的模拟游戏,CIAYO故事(CIAYOStories)讲述的是青春岁月时期的恋情,玩家将以主角的身份进入体验恋爱的感...
精灵宝可梦时空之痕3.09正式版免费下载
1,910.8M
精灵宝可梦时空之痕3.09版本地图是一款对抗玩法的魔兽地图,玩家可以和小伙伴们一起选择对抗模式,也可以和玩人机对抗模式,地图设计精美,值得体验!精灵宝可梦时空之...
虎虾转app下载-虎虾转app红包版1.0.0手机版
1,028.1M
又是一款手机在线通过自己额微信转发文章就可以赚钱的平台,这里主要就是给用户提供一个快速简单的赚钱的平台,还是相当而言比较方便的,单价也不是很低,每天赚个几元钱,...
二四节秋分ppt图片素材高清版
798.1M
二四节秋分已经正式的开始了!相信很多人都是知道的,现在为大家带来二四节秋分ppt图片,可以让你直接的进行查看,如果你对这个感兴趣的话就可以使用哦!二四节秋分介绍...
吾爱论坛网络诊断修复工具1.8绿色版
1,450.5M
吾爱破解论坛访问诊断修复工具是一款可以修复您无法进入吾爱破解论坛的优秀处理工具,使用这款吾爱破解论坛访问诊断修复工具可以让你不会因为吾爱破解论坛无法登录而烦恼。...
疯狂爆射手游1.2 安卓版
1,762.4M
休闲卡通的射击闯关手游,疯狂爆射手游加入了一些打砖块的元素,上面的数字就是显示你需要射击多少下才能够消灭,不断加强和解锁酷装备。游戏玩法玩家将控制飞行战机在一个...
京诚鲜生下载-京诚鲜生app2.0.13 安卓最新版
937.5M
这是一款非常好用的生鲜超市在线配送软件,很多房山市市民都在使用这个平台,价格实惠,一小时内送达,品种繁多,新鲜也是有保障的!软件简介京诚鲜生是一款手机生鲜超市。...
将夜传说魔地藏手游下载-将夜传说魔地藏安卓版1.9.5 最新版
2025/11/08 14:50
Riot Civil Unrest破解版-冲突动荡Riot Civil Unrest未加密版中文硬盘版
2025/11/10 15:11
嘟嘟租号下载-嘟嘟租号app1.0.15 最新版
2025/11/02 09:58
车e通下载-车e通3.0.21.91官网安卓最新版
2025/10/29 12:43
宝宝房间清理装扮下载-宝宝房间清理装扮游戏1.1.3 安卓手机版
2025/11/04 00:29
快科技app下载-快科技(科技资讯软件)4.7.7安卓最新版
2025/11/06 12:03
像素星球APP下载安卓版-像素星球-拼豆团设计工具(Dot Lab)2.1.3 最新版
2025/11/10 11:33
画师联盟APP官方下载-画师联盟APP2.0.0 最新版
2025/10/22 09:40
美女三国1.0安卓版
2025/11/03 00:31
宇龙数控仿真系统(yulong) V3.8完美破解版
2025/11/07 18:10
狗叫翻译器软件下载-狗叫翻译器app5.6.5 安卓最新版
2025/10/27 20:06
哎哟民宿app下载-哎哟民宿手机版1.0.0 安卓版
2025/11/08 01:56
少年悟空传飞升版1.7.1安卓版
2025/10/25 17:43
Wicap抓包防封工具下载中文版-Wicap抓包工具2.8.2 最新版
2025/10/26 07:13
51狼人杀下载-51狼人杀手游1.0.7 安卓版
2025/10/23 00:19
51狼人杀下载-51狼人杀手游1.0.7 安卓版
2025/10/23 00:19更新
狼人杀游戏可以很好的锻炼人讲话,今天小编带来的51狼人杀手游是一款日式英伦画风的在线轻社交游戏,还是经典的玩法,不过难度升级,万人在线竞技对战,最火爆的狼人杀交...
支持 ( 114 ) 盖楼(回复)
支持 ( 27 ) 盖楼(回复)
支持 ( 65 ) 盖楼(回复)
支持 ( 159 ) 盖楼(回复)
支持 ( 147 ) 盖楼(回复)
支持 ( 137 ) 盖楼(回复)
支持 ( 63 ) 盖楼(回复)
支持 ( 134 ) 盖楼(回复)
支持 ( 83 ) 盖楼(回复)
支持 ( 185 ) 盖楼(回复)
支持 ( 165 ) 盖楼(回复)
支持 ( 116 ) 盖楼(回复)
支持 ( 140 ) 盖楼(回复)
支持 ( 180 ) 盖楼(回复)
支持 ( 181 ) 盖楼(回复)
支持 ( 175 ) 盖楼(回复)
支持 ( 144 ) 盖楼(回复)
支持 ( 128 ) 盖楼(回复)
支持 ( 18 ) 盖楼(回复)
支持 ( 93 ) 盖楼(回复)