
类型: 教育培训 版本: V2.3
大小: 911.9 时间: 2025-11-21





<?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插件安装方法]同传翻译能赚多少钱
WordPress视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

在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
第二银河怎么挣钱
1,326.9M
节奏盒子活泼的公子模组(SprunkiHorrorDandyModSong)超人盒子SprunkiDandy的世界Mod是一个有趣的和令人上瘾的节奏游戏,具有独...
说说短视频能提现到账
1,520.0M
蜀道难是唐代诗人李白的作品,以浪漫主义的手法表现了蜀地山川的壮秀,小编带来了蜀道难ppt课件,老师可以用来备课!蜀道难ppt课件预览教学目标1.基础知识目标:读...
网上赚钱一天能赚一百的
408.4M
智慧水务app是一款非常实用的软件,软件主要帮助用户进行于监控二次供水设备的数据详情,让你能够实时了解数据,保证其安全稳定!软件介绍该应用主要用于监控二次供水设...
同升国际注册即送58
32.7M
火柴人射击恐怖分子游戏是一款很好玩的射击类游戏,游戏玩法模式都很简单,玩家可以选择丰富的武器系统来进行射击那些恐怖分子,最终赢得胜利!游戏介绍问候火柴人!你有时...
最靠谱的兼职网站
320.8M
无痕读书去广告版为大家去掉了软件中的广告哦,很多人都喜欢用这款软件来看小说电子书,体验非常的好,软件也是完全免费使用的,里面的小说漫画资源很多很丰富,男生女生喜...
玩秘乐赚钱吗
775.6M
GIF表情菌手机版是一款手机斗图软件,软件网络全网最新最热表情包,用户可以通过软件搜索自己想要的表情包风格,保存下载,发送至微信或是QQ,有了GIF表情菌软件,...
在哪里看小说赚钱最多
98.6M
知音是一款专为单身人士设计的社交应用,旨在帮助用户寻找合适的伴侣。知音交友软件采用先进的匹配算法,根据用户的兴趣爱好、性格特点和生活习惯等,为用户推荐最适合的交...
新人注册送58元平台
15.6M
家居风水大师app可以帮助很多的需要对家居进行了解的以及测试的朋友,自己可以在家里进行体验的了,心动以及有需要的朋友就可以在自己的手机上下载这款软件!家居风水大...
游戏挣钱多么
1,348.9M
月灵超变散人服是一款非常热血刺激的传奇手游,游戏画面品质很高,玩法经典,主要是游戏的福利很棒,爆率很高,会免费送很多的资源,还支持离线挂机,平民玩家也能玩的全新...
当前挣钱行业
1,559.4M
是一款专注于瑜伽行业的学习服务软件,软件为用户提供直播教课,私教为你讲解瑜伽等,另外还可以进行场馆出租等,为瑜伽从业者更好的进行办公教学!儒美客介绍儒美客专为瑜...
亲朋棋牌苹果下载
618.8M
虽然不少人都开始慢慢的在接触全职大师这款游戏,但却很少人有耐心去官网上进行更新,这时小编就给大家推荐全职大师更新补丁,只需要借助他就能够自动帮你进行更新游戏客户...
网络棋牌买分
353.9M
黎明大陆手游ios版是一款角色扮演3D大作,推出全新竞技PK玩法,体验百变早先,酷炫技能战斗,多种玩法,全新武侠,快来下载游戏加入战斗吧!游戏介绍《黎明大陆》是...
2017年最赚钱餐饮项目
1,801.6M
点点管家手机版是目前来说最便捷最为齐全的服务类app,为用户提供各种生活上的小帮助,生活中的各种难题都可以在这里解决。安全、舒适、优质的居家环境在这里得以实现。...
天天快报发文章赚钱吗
808.1M
淘金量化智投--股票量化策略投资简介:淘金量化智投以“人工智能+量化技术”为核心驱动,专注服务个人投资者,提供智能交易机器人和量化策略两大核心产品。为广大投资者...
上海棋牌哈灵斗地主
1,112.6M
这是一款非常好用的健康商户管理的软件,很多用户都在关注,通过这个软件可以实时查看你的订单,管理你的店铺状态,各种数据统计等!软件介绍健康管理平台是百鸿健康管理打...
金贝棋牌2017版
2025/11/16 06:30
百度app可以赚钱吗
2025/11/07 21:58
丹东集杰棋牌乐官网
2025/11/15 03:48
一天赚一亿的项目
2025/11/21 18:01
微信加好友兼职在家也可以做
2025/11/23 08:05
偏门项目网怎么进
2025/11/24 18:21
配电项目赚钱吗
2025/11/07 10:36
app试玩平台赚钱软件
2025/11/10 16:47
美女兼职河南
2025/11/22 09:03
加盟信贷公司如何挣钱
2025/11/19 03:55
自己出版一本书能赚多少钱
2025/11/12 01:04
送648充值游戏
2025/11/24 15:38
刚刚进圈怎么赚钱
2025/11/20 13:23
养牛赚钱不
2025/11/10 01:06
买辆小车能怎样赚钱
2025/11/12 19:30
买辆小车能怎样赚钱
2025/11/12 19:30更新
虎将闯三国手游ios版是一款三国回合制策略手游,Q版萌萌的三国人物,挂机就能刷等级和装备,快来下载游戏带领你的三国萌将们为你打下江山吧!游戏介绍《虎将闯三国》是...
支持 ( 185 ) 盖楼(回复)
支持 ( 126 ) 盖楼(回复)
支持 ( 153 ) 盖楼(回复)
支持 ( 142 ) 盖楼(回复)
支持 ( 43 ) 盖楼(回复)
支持 ( 189 ) 盖楼(回复)
支持 ( 56 ) 盖楼(回复)
支持 ( 16 ) 盖楼(回复)
支持 ( 112 ) 盖楼(回复)
支持 ( 65 ) 盖楼(回复)
支持 ( 22 ) 盖楼(回复)
支持 ( 96 ) 盖楼(回复)
支持 ( 109 ) 盖楼(回复)
支持 ( 27 ) 盖楼(回复)
支持 ( 133 ) 盖楼(回复)
支持 ( 143 ) 盖楼(回复)
支持 ( 60 ) 盖楼(回复)
支持 ( 111 ) 盖楼(回复)
支持 ( 121 ) 盖楼(回复)
支持 ( 45 ) 盖楼(回复)