<?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)安装方法乐孕佳app-乐孕佳1.3.2 安卓版【官方版】
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
[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
3d走势图最全 锁连亚盘 哈市11选五 易博娱乐国际 双色球杀号高手展开内容
坦克物理模拟器下载-坦克物理模拟器1最新版3.2 最新版
5款卡通风格网站模板PSD素材高清免费版
恐怖奶奶圣诞版本下载-恐怖奶奶圣诞版8.19 手机版
少年三国志热血版ios下载-少年三国志热血版手游3.7.27苹果版
国承信贵金属交易软件1.0 官方最新版
中国民间美术ppt课件-中国民间美术ppt下载精选版
非神勿扰破解版下载-非神勿扰内购破解版1.0.0 最新版
MIUI7小米2s开发版刷机包下载-MIUI7小米2s开发版刷机包1.0 官方最新版
医联手机客户端-医联app8.6.3 安卓免费版
起点读书eink下载-起点读书eink定制版7.9.280 最新版
极速浏览器3.0.11.2 正式版
凡人修真传BT果盘版1.0.0 安卓版
股拍app官方下载-股拍app官方下载8.4.0 官方最新版
好司机软件3.5.1 最新版
青春湾软件下载-青春湾app2.0.12 安卓版
荒野行动手游公测版下载-荒野行动公测版1.240.439446 安卓手机版
7.5/1,222.8M
网易大逃杀游戏荒野行动已正式开测,时面有很多需要射击的场面,所以透视自瞄辅助可以起到很大的作用,能帮助玩家更快更便捷的吃鸡。可以自动瞄准的射击辅助荒野行动自瞄透...
7.6/196.6M
灭神之神6.53转生是一款具有挑战性的防守魔兽地图,地图支持1-6人同时在线游戏,最新版丢增加新转生系统,削弱一念之间属性加成。本站为大家带来最新版地图资源,感...
nfc tools pro汉化版下载-nfc tools pro复制卡app8.9 付费专业版
7.7/581.3M
非常强大的NFC软件,nfctools-proedition,此版本为付费专业版,读取nfc卡,可复制可编写可改写,用NFc来自动化你的设备。软件介绍NFCTo...
9.0/304.9M
这是一个珠宝电子商务平台,主打各种珠宝出售,没有中间商赚差价,品质有保障,各种五金首饰这里都有,可以详细地查看商品的一些信息等等!软件介绍睿惠宝app是一款掌上...
7.7/1,250.2M
羊羊模拟器是一款能赚钱的消除手游,在游戏之中玩家能通过消除闯关来获取现金红包,消除的越多,所获取的红包金额也就越大,玩起来趣味性很强,感兴趣的小伙伴快来东坡下载...
9.7/1,059.4M
不可能的坡道游戏是一款以竞赛为玩法的手游,有着可以在众多幻想的车道进行赛跑,以各种不同的形态进行竞速,需要注意的是不要掉下去,注意躲避危险!不可能的坡道游戏怎么...
8.1/135.6M
南水北调移动办公系统APP是为河南省南水北调河南分局OA系统移动办公的软件,主要是为用户日常办公提供方便。有需要的朋友赶紧来东坡下载吧!南水北调移动办公系统功能...
萌萌来电秀安卓版-来电显示美化(萌萌来电秀)1.0.0 安卓最新版
8.0/1,138.8M
普通的来电显示界面单调无趣,看多了会有审美疲劳,这款萌萌来电秀来电显示美化软件给用户带来独特有趣的来电显示界面,让你接电话有个好心情!萌萌来电秀介绍萌萌来电秀是...
9.2/836.5M
软件是中文课堂学习app,可以学习众多的知识,各种不同的教育内容可以自由查看,包含了中小学中文知识,以科学的记忆方法,让大家学习更加有效率!春晓学堂app介绍致...
行车记录仪sos客户端-行车SOS客户端4.3.7.8 无广告中文版
7.8/258.4M
行车sOS,是翼卡车联网推出的专注于车主安全的可视化应用服务。通过事故识别算法识别事故严重等级主动发起可视化生命救援,直达最近120,缩短救援时间,降低交通死亡...
墨九社区苹果手机版官网下载-墨九社区苹果手机版1.0.0 ios最新版
8.9/1,463.7M
墨九社区苹果手机版是专门为二次元cosplay爱好者研发的一款手机社交苹果端,这里聚集了非常多的爱好者大家可以互相讨论心得快来东坡下载看看吧!墨九社区苹果手机版...
9.9/505.6M
轨道出租车3D安卓是一款全新的安全驾驶游戏,轨道出租车3D游戏里游戏玩家们所安全驾驶的出租车可能是一辆酷炫的过山车,你能运用你的手指头操纵全部过山车,体会最瘋狂...
崩坏星穹铁道ios官方下载-崩坏星穹铁道手游苹果版3.4.0 官方版
9.7/707.0M
崩坏星穹铁道ios版本现已登录苹果AppStore下载,米哈游新作;继承了崩坏系列前几部作品的核心,在这个广阔的银河世界中开启冒险挑战,精美的美术画面带来全新的...
布偶必备工具下载-布偶必备工具软件最新版本5.8.7 安卓版
8.6/516.8M
实用性很强的一个聚合工具软件,布偶必备工具APP的功能很多,有娱乐方面的,支持全面解析歌曲,可以自己制作透明头像,还有一些qq实用功能,有需要的可以免费下载使用...
8.1/1,772.1M
智点通手机客户端为你提供最新最及时的人事资讯,在这里你可以找到你需要的人事信息,找到自己满意的工作,当然还有一些其它的功能都是智点通手机客户端的特色!软件介绍智...
7.5/45.3M
猛鬼猎梦者版是一款全新推出的策略塔防手游。游戏有着紧张刺激的闯关节奏,玩家需要对抗更多的猛鬼抵御敌人的入侵。多种游戏模式,丰富的游戏关卡等你来战,让你体验不一样...
9.7/261.2M
随时的学习到各种网上知识,在这里有很多的前辈都是为你提供各种各样的经验知识进行分享,你可以直接在线的一个个的去学习以及研究,提升你自己的能力!小灯塔介绍“小灯塔...
7.6/411.7M
青岛地铁通是为青岛地铁出行服务的软件,在这个上面我们可以一键查询站点、路线、周边信息,了解票价、时间等内容,信息丰富,更新及时,获取最佳换乘方案,轻松提醒,地铁...
7.5/1,612.2M
美柚瘦身app是一款美体塑形减肥软件,定量饮食+运动,个性化减肥方案,记录每天消耗,达人分享超励志瘦出完美曲线的美丽秘籍。功能介绍【每日记录,雕刻你的瘦身之路】...
2017年世界地球日宣传活动方案-2017年世界地球日宣传活动方案大全精美版
7.5/1,468.8M
世界地球日(WorldEarthDay)即每年的4月22日,是一项世界性的环境保护活动。2009年第63届联合国大会决议将每年的4月22日定为“世界地球日”。下...
自定义全局透明壁纸apk下载-自定义全局透明壁纸app1.0.0 安卓最新版
9.4/1,754.4M
自定义全局透明壁纸app是一款手机美化软件,设置个性化的透明的手机壁纸,把你的手机变成一个透明的屏幕,支持文字编辑,让你的手机超级个性化。自定义...
9.2/1,272.2M
财圆滚滚是一款可以领取红包的休闲小游戏,在游戏之中玩家可以玩到各种有趣的小游戏,闯关领取现金红包,然后玩家就能直接提现到绑定账号,感兴趣的小伙伴快来uzzf东坡...
9.3/1,125.0M
自己的家还是需要自己来装饰,在网上不知道怎么购买的话,可以使用居住空间app,直接的可以网上订购,免费的为你送上门服务,解决你的一些问题!居住空间官方介绍居住空...
9.9/440.7M
信息全面的企业信息及知识产权商业查询,汇桔查app多维的进行监控,监控企业全方位的进行追踪,检查报告免费下载查看。功能介绍便捷查询:无需登录,随时随地查询企业及...
妞妞画质怪兽.cn下载正版-妞妞画质怪兽120帧安卓版下载2.5 最新版
8.8/1,978.6M
画质怪兽v2.5(妞妞同款),经典的画质助手,功能和之前的画质工具都是差不多的,需要提醒大家的是,这个软件是需要付费获取的,也可以做任务免费获得卡密,支持安卓+...