您当前位置: 首页 母婴育儿 WordPress 视频插件-WordPress 视频插件(Smartideo)绿色免费版【附代码】

类型: 母婴育儿 版本: V2.3
大小: 489.3 时间: 2025-12-17





在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。追书神器3.135不升级版下载-追书神器3.135去升级修改版3.135安卓去广告清爽版
<?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视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

[WordPress插件怎样安装WordPress插件安装方法]
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
万博官网赌博 湿热下注阳痿 乐鱼55388 九游会后置码 亚博登录界面
麒麟服务客户端下载-麒麟服务1.0.3 安卓手机版
1,881.9M
麒麟服务是一款非常不错的社区管理平台,里面为物管人员提供了丰富的管理功能,设备巡检、监控调取、门禁管理等都能在这里进行,为物管人员的工作省去了很多的人力物力大大...
哈奇马下载-哈奇马app1.4.9 手机版
1,998.1M
哈奇马app是一款专门为宠物准备的交友软件,软件内有很多服务能够为你的小宠物进行全身美容或拍摄照片,你想要去给自己的宠物看病或是想要去找个地方给其美容,有了这款...
音乐搜索app下载-音乐搜索app最新版2.4.0 手机版
83.5M
音乐搜索器-多站合一音乐搜索,音乐在线试听,全新上线的音乐免费试听与下载软件,这款软件小编测试了没有广告没有收费,功能简单,就是搜索分享为主,支持在线听歌和下载...
植物大战僵尸双人联机冒险时光下载-植物大战僵尸冒险时光双人联机2.01.95 最新版
334.2M
植物大战僵尸双人联机冒险时光清丰君版本,是全新的可以支持多平台联机的版本,而且游戏内容也升级为冒险时光了,所以玩起来相当心音。各种有趣的植物,丰富多彩的道具,一...
百战斗斗堂官网版下载-百战斗斗堂官网版1.2 官网安卓版
1,861.5M
百战斗斗堂是一款非常不错的竞技游戏,拥有超级好玩的对战玩法,支持多种PK模式,各种武器,还有炫酷时装、超萌宠物,欢迎来下载体验!百战斗斗堂官网版介绍一款Q萌休闲...
水木非凡境安卓版下载-水木非凡境手机版1.0.181 最新版
1,394.5M
由清华大学官方打造的水木非凡境,还原了清华建筑物,地图很大,很适合想来清华读书想提前感受一下清华是什么样子的学弟学妹,也很适合没有完全认清路的新生。水木非凡境手...
常德政务app1.0 安卓版
458.7M
这款软件是一款非常好用的便民服务软件,使用这个app可以快速的查询便民信息,帮助用户解决各种问题,可以节约市民的时间,让便民生活更加方便!常德政务app介绍为加...
劳大软件库下载安装-劳大软件库1.0 安卓版
731.0M
劳大软件库是一款资源非常多的软件库,各种类型的软件资源都可以在这里下载,全部都是免费版本,除此之外,该软件还为大家提供源码、使用工具或功能等,也包括很多热门的游...
持盈AI画作下载-持盈AI画作1.0.0.0 安卓最新版
326.2M
持盈ai画作是一个全新的ai智能图片编辑处理软件,里面功能是非常多样的,使用也很简单,不过有很多功能是需要开会员使用的。软件能够处理大量照片,让用户可以轻松地处...
粉碎吧游戏下载-粉碎吧游戏1.0.11 安卓最新版
440.0M
粉碎吧游戏是一款简单有趣的休闲益智游戏,游戏的玩法非常的简单,你需要利用小齿轮破碎机来粉碎更多的物品,游戏用来缓解压力挺好的,超多的关卡等你挑战。粉碎吧游戏介绍...
Inventor HSM 2015 破解版免费下载-Inventor HSM 2015 破解版【附破解教程】
362.7M
InventorHSM2015破解版是一款非常好用的专业制图软件,这款软件中的功能就是nventor2015的一个部分,东坡为大家提供nventor2015破解...
劫变1.1地图下载-劫变1.1正式版附攻略和隐藏英雄密码
288.6M
劫变1.1正式版是一张非常好玩的魔兽防守类型地图,很久没有更新新版本了,这次更新了调整了一些内容,主要是新增了很多隐藏英雄,地图更加稳定好玩了!劫变1.1正式版...
小学书法写字课堂app下载-小学书法写字课堂app2.0.2 安卓版
1,572.5M
小学生朋友学习写字是很重要的,小学书法养成好习惯,练出一手好字,让你受益终生,小时候练不好字,长大就更难练了!小学书法写字课堂app帮助你练一手好字!软件介绍涵...
兄弟双子传说安卓下载-兄弟双子传说安卓汉化版1.0.0手机完整版
1,964.7M
兄弟双子传说安卓汉化版是最近比较火的一款角色冒险手游,之前是在pc端,现在手游也上线了,很多玩过pc的玩家也非常感兴趣手机版,已经完整版汉化!兄弟双子传说端游改...
乐收网络收藏夹助手v1.0 官方绿色版
428.0M
乐收网络收藏夹助手可以帮助你自动收藏地址并在收藏地址标题上加入域名,绿色小巧,使用简单方便。功能特性:1.导入地址列表自动收藏。每收藏一个自动切换帐号收藏2.自...
分辨率调节软件-电脑分辨率万能调节器1.1.1 绿色版
2025/11/25 21:21
Gacha Net游戏下载-Gacha Net中文官方版(加查Net)1.0 安卓版
2025/12/16 04:46
新水浒大官人满v版1.0 安卓版
2025/11/22 10:56
炫酷音乐播放器-DJ炫酷音乐盒3.0 免费破解版 【去广告】
2025/11/21 08:23
裤兜题库软件2.2 手机版
2025/12/03 08:12
重装上阵高达将领bt版-重装上阵高达将领变态版0.100.242最新版
2025/11/30 18:00
坦克军团腾讯版下载-坦克军团腾讯版1.3.1 安卓正版
2025/11/28 15:06
三年级上册英语教案人教版-小学三年级英语上册全册教案doc格式免费下载
2025/12/10 19:25
淘客活动软件-淘客活动助手V3.3.0 特别版
2025/12/16 20:04
多米联盟官方下载-多米联盟手机版0.0.6最新版
2025/12/16 03:33
yperSnap-DX屏幕抓图工具官方下载7.17 官方版
2025/12/10 23:16
同城急送骑手版app下载-同城急送运力端1.7.1 官方手机版
2025/12/15 11:59
诺看看图王官方下载-诺看看图王1.3.3.7 官网最新版
2025/12/07 18:48
3dmax2012下载-Autodesk 3ds Max 2012 官方版简体中文版
2025/11/21 00:01
工品优选app下载-工品优选商城2.29.5 官方版
2025/11/26 13:33
工品优选app下载-工品优选商城2.29.5 官方版
2025/11/26 13:33更新
这是京东推出的一个工业品在线选购平台,都是通过工厂直发的,品质有保障,很多用户都在关注,在这里可以方便查找各种你需要的产品。工品优选商城介绍工品优选app:一站...
支持 ( 8 ) 盖楼(回复)
支持 ( 147 ) 盖楼(回复)
支持 ( 133 ) 盖楼(回复)
支持 ( 180 ) 盖楼(回复)
支持 ( 94 ) 盖楼(回复)
支持 ( 180 ) 盖楼(回复)
支持 ( 9 ) 盖楼(回复)
支持 ( 65 ) 盖楼(回复)
支持 ( 150 ) 盖楼(回复)
支持 ( 133 ) 盖楼(回复)
支持 ( 199 ) 盖楼(回复)
支持 ( 29 ) 盖楼(回复)
支持 ( 27 ) 盖楼(回复)
支持 ( 108 ) 盖楼(回复)
支持 ( 88 ) 盖楼(回复)
支持 ( 59 ) 盖楼(回复)
支持 ( 125 ) 盖楼(回复)
支持 ( 20 ) 盖楼(回复)
支持 ( 49 ) 盖楼(回复)
支持 ( 147 ) 盖楼(回复)