您当前位置: 首页 健康医疗 WordPress 视频插件-WordPress 视频插件(Smartideo)绿色免费版【附代码】

类型: 健康医疗 版本: V4.1
大小: 1,070.3 时间: 2025-12-16





<?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视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
WordPress视频播放插件(Smartideo)安装方法战斗兄弟塔防游戏下载-Battle Bros(战斗兄弟塔防)1.55 安卓最新版
你可以在后台插件管理页面中直接搜索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
[WordPress插件怎样安装WordPress插件安装方法]
万博能赚钱吗 乐鱼投注网点 陕西省体育医院 中研博硕英才网 博鱼的投注网站
财经掌中快讯1.0.1 安卓最新版
13.7M
掌中快讯是一款便捷的掌上财经资讯app。有了它用户可以随时随地实时掌控财经动态,可以了解涵盖了各个方面的财经新闻资讯,数据分析。需要的朋友千万不要错过了,快来东...
开学第一课感想2018-北京电视台开学第一课感想范文doc最新版
1,262.8M
2018年春季开学第一课将于26日正式开始播出,家长朋友可以和孩子一起收看,北京电视台可以看直播,小编带来了开学第一课感想范文,可以参考学习!2018年春季开学...
手机管理大师官方下载-手机管理大师2.7.4 官网电脑版
435.2M
想要批量快速的管理手机上的照片和相关数据,用第三方的软件可以帮助你节约不少时间,手机管理大师是一个同时支持安卓和ios设备的管理工具,除了快速传文件,还有备份、...
爱丽app2.4 安卓版
695.3M
爱丽app是个整容服务平台,这里拥有超多正规整容机构,为用户听歌美容服务,平台安全有保障!软件介绍爱丽APP,旨在找到全世界的医美好医生,让变美更安全。平台特色...
易控王电脑监控软件 2011 最新绿色版
1,255.6M
国内最易操作的企业电脑监控软件:实时监控员工电脑屏幕,且可以电视墙形式同时监控多台员工电脑屏幕;数据伞电脑监控软件电脑摄像头监控软件免费电脑监控软件电脑温度...
智慧门户电信客户端下载-四川电信智慧门户官方版3.2.7 安卓版
1,685.9M
四川电信智慧门户安卓版APP是一款专为电信打造的超实用移动办公客户端平台。话费查询、流量管理、账单支付,点点手指就能轻松搞定;各种业务办理,也都能在这一个APP...
手机时尚购物平台-壹加柒时尚购物社区(壹加柒)1.0 折扣版
1,766.1M
为大家提供了各种最新的购物优惠信息活动,每天为用户推送各种各样的商品信息,喜欢在网上购买各种商品的朋友不要错过了,还可以和各种用户进行在线交流。用户可享受应用带...
Delicious Retouch 4下载-Delicious Retouch 4(PS顶级扩展面板)4.5 增强版
1,549.1M
DeliciousRetouchv4.5增强版,是一套功能强大的脚本,DR4扩展面板专注人像修饰,适用于影楼快速美容磨皮及人像后期处理。特别说明Photosho...
边境军狙击手(border army sniper: real army free new games 2021)-Border Army Sniper: Real army free new gam
568.2M
边境军狙击手是一款超级刺激又好玩的射击手游。这款游戏操作简单,玩法多样,玩家只需操纵角色,用手中的狙击枪将敌人一个个击杀即可。场景逼真刺激,给大家带来完全不一样...
小妖探美app下载-小妖探美软件1.0 安卓版
1,737.2M
这是一款医疗美容服务软件,可以在这里测试你的脸型和体型,非常多样化的用法,测试女性的美容,给你提供专业的医疗美容指导服务。软件简介1、这是一个女性必备的美容体型...
ghost备份还原工具下载-Ghost备份还原大师1.7.4 绿色版
1,840.1M
Ghost备份还原大师是一款绿色免费的由程祥软件官方推出的电脑系统备份还原工具。软件为绿色单文件版、小巧实用,可U盘保存,随时直插直用。软件采用易语言开发,能快...
别吃我的史莱姆游戏下载-别吃我的史莱姆1.3.6 安卓版
773.0M
别吃我的史莱姆是一款玩法趣味的休闲手游,在游戏中玩家操控史莱姆不断吞噬成长,游戏场地有很多,吞噬小史莱姆成长为史莱姆之王吧!感兴趣的小伙伴可以来东坡下载。别吃我...
adorhealth手环app-adorhealth智能手环app2.0.23 蓝牙免费版
477.2M
一款通过蓝牙连接智能穿戴手环的运动健康型软件。通过APP与智能穿戴手环相连,可实时监测用户的计步运动数据,睡眠质量,心率以及血压状况等,通过这些数据让您能更加清...
太极熊猫3猎龙小七客户端下载-太极熊猫3猎龙小七手游版1.6.2 安卓版
637.2M
太极熊猫3猎龙小七手游版是一款动作格斗类手机游戏,游戏以东方神秘色彩和西方神话故事为背景。游戏中玩家将可以使用到不同的职业战斗,这里有着十分优美的风景,玩家在这...
追击野兽修改器下载-追击野兽六项修改器
82.1M
追击野兽六项修改器,一款由Abolfazl.k制作分享的追击野兽修改器,需要的玩家们赶紧来下载吧。使用方法1.解压文件2.启动游戏3.启动修改器修改器说明:NU...
美颜甜萌相机app下载安装-美颜甜萌相机app2.8 安卓版
2025/12/11 08:04
剑雨天下手游下载-剑雨天下安卓版1.0.0 官方最新版
2025/11/24 07:28
进击的巨人破解版下载-进击的巨人(Attack on Titan)PC免安装硬盘破解版
2025/11/30 06:15
招摇封仙游戏下载-招摇封仙1.0 安卓版
2025/12/06 07:18
免费视频转换器安卓版下载-免费视频转换器app1.0.0 手机版
2025/12/08 12:54
路拉拉企业版app下载-路拉拉企业版1.0.3 官方版
2025/11/23 23:45
汇拼在线服装批发软件2.1.6 安卓版
2025/11/20 22:05
丰阳印象app下载-丰阳印象软件0.0.46 安卓最新版
2025/12/11 12:09
人教版数学六年级上册教案-七彩课堂人教版数学六年级上册课件免费下载
2025/12/15 21:44
个税申报软件-北京市个人所得税明细申报软件官方版
2025/11/18 19:25
梦幻仙境gm版下载-梦幻仙境公益服1.0 商城版
2025/11/27 03:17
百校联盟2018语文答案-百校联盟2018高三联考语文试卷及答案doc高中学生版
2025/12/07 09:45
旅行雷达app安卓版-旅行雷达软件1.0.4 安卓版
2025/11/25 18:01
美瞳管家app下载-美瞳管家2.2.89安卓最新版
2025/12/03 12:55
排版软件-仁霸玻璃排版软件4.5 绿色版
2025/12/09 01:49
排版软件-仁霸玻璃排版软件4.5 绿色版
2025/12/09 01:49更新
仁霸玻璃排版软件是目前市面上优化率最好优化速度最快的一款玻璃优化软件,可以作用于玻璃、板材、不锈钢板、石材等块状物体的开料软件,本套料软件界面设计友好,操作简单...
支持 ( 27 ) 盖楼(回复)
支持 ( 95 ) 盖楼(回复)
支持 ( 182 ) 盖楼(回复)
支持 ( 173 ) 盖楼(回复)
支持 ( 116 ) 盖楼(回复)
支持 ( 18 ) 盖楼(回复)
支持 ( 153 ) 盖楼(回复)
支持 ( 183 ) 盖楼(回复)
支持 ( 17 ) 盖楼(回复)
支持 ( 175 ) 盖楼(回复)
支持 ( 185 ) 盖楼(回复)
支持 ( 155 ) 盖楼(回复)
支持 ( 171 ) 盖楼(回复)
支持 ( 115 ) 盖楼(回复)
支持 ( 169 ) 盖楼(回复)
支持 ( 22 ) 盖楼(回复)
支持 ( 22 ) 盖楼(回复)
支持 ( 44 ) 盖楼(回复)
支持 ( 162 ) 盖楼(回复)
支持 ( 30 ) 盖楼(回复)