/*
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
在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
展开内容
指令视频app下载-指令视频app1.1.5 安卓最新版
玄元之争游戏下载-玄元之争卡牌游戏1.1.12草花游戏
河南政协app下载-河南政协1.0.84 官方版
斗金传1.1地图补丁下载-魔兽地图:斗金传1.1破解版1.1 自制神装+无cd+详细攻略
爱常信app下载-爱常信1.3.3安卓最新版
洋葱韩语下载-洋葱韩语app2.0.4 官方版
边狱巴士肉斩骨断手机版下载-边狱巴士肉斩骨断同人游戏1.0 安卓版
万年历黄历app下载-万年历黄历日历下载6.5.2 安卓最新版
迅雷10电脑版官方下载-迅雷10(迅雷x)10.1.8.284官方正式版
趣教app下载-趣教英语软件2.2.4 手机版
蘑菇头表情包下载-蘑菇头表情包制作最新网页版
手机护眼软件哪个好-护眼助手(手机屏幕护眼软件)1.6.2 安卓版
中国天气网气象雷达图app-实时气象雷达app1.3最新版
混沌挂机游戏渠道版下载-混沌挂机手游私服版1.0安卓版
萌犬进化手游下载-Dog Evolution(萌犬进化安卓版)27.0.0 官方版
王者猎人手游下载-王者猎人手游2025最新版2.0.3 安卓版
9.9/215.5M
王者猎人安卓版是一款角色扮演类的游戏。王者猎人游戏中职业分为2大类,法师还有剑士,各有特色。王者猎人安卓版游戏玩法丰富,画面精致,让你沉浸在其中。喜欢的网友快俩...
9.1/1,154.5M
时代无忧app是一款生活小工具,汇聚了快递查询、二维码识别等多种实用小工具,简单好用,速度快!时代无忧app功能1.快递查询,输入快递单号和选择快递公司后可查询...
8.7/1,355.0M
全新仙侠恋爱MMORPG手游《遇龙三生》重磅来袭!精心制作的各大职业,精美画面打造全新的仙侠风新世界!玩家可以通过扮演角色,探索新的世界获得乐趣。特色的伙伴、坐...
城市设计师2游戏下载-Designer City 2(城市设计师2手游)1.06安卓版
9.1/1,189.1M
城市设计师2手游是一款经营类游戏,玩家扮演一名设计师,你需要为这座城市合理规划各种建筑物的放置,以此吸引更多的居民入住,有的建筑还能获得收益,扩大城市的范围吧,...
9.8/1,480.5M
酷狗手机铃声制作软件是一款免费的手机铃声制作软件,可以剪辑一首完整的歌曲,根据自己的需要设置起点和终点,截取自己喜欢的声音片段设置为手机铃声。酷狗手机铃声制作软...
8.2/1,173.8M
苹果网络电台是国内第一款集网络电台(广播)传输、解码、播放于一身的程序产品,文艺需安装,即可在线收听许多广播节目。程序会在以后更新更多的节目.居全球同类程序之首...
md5校验工具-md5校验器(Hasher lite)3.1.0.5 汉化版
7.8/871.3M
关于md5很多学计算机的网友们都应该懂。每个文件都可以用HashMD5验证程序算出一个固定的MD5码来。那么md5校验器(Hasherlite)这款软件怎么样呢...
7.7/1,330.4M
导学号app是一款专为中小学生打造的作业辅导软件,能为学生提供一键拍照解题,为你提供各种解题思路和方法,让你更快更好的解决难题,完成作业。是你学习的好帮手,想要...
瑞证通app最新版下载-瑞证通网上服务平台1.0.0 安卓手机版
9.0/273.9M
瑞证通网上服务平台专业为各色企业用户打造的数字证书管理平台,能够时刻为你提供最为便捷的办公方式,大大推动了其工作效率,平台还有众多热点资讯可供用户了解,非常的方...
教师资格证书补办-教师资格证书补发换发申请表doc格式【word版】
9.2/288.1M
辛辛苦苦到手的教师资格证书结果一不小心给弄丢了,这可怎么办呢?当然是速度补办了!但你知道吗?在补办教师资格证书之前你需要向相关主管部门递交一份教师资格证书补发换...
8.1/1,358.2M
麦田写字王app是专门针对儿童打造的一款写字练习软件,提供了丰富的功能和小游戏,适合3-12岁的孩子进行练字、绘画训练。使用方法通过智能手写输入设备(麦田智绘神...
9.7/1,097.7M
逸梦绘画是一款非常好用的手机端的绘图工具,上面有非常多的绘画模板,各种不同的颜色、背景都可以让你使用,可以制作出更多优质的绘画作品,打造个人创作,喜欢画画的朋友...
8.6/1,060.0M
这款软件是一款购物软件,在上面你可以选购各种商品,每一个商品价格都是非常优惠的,购买商品可以直接领取优惠卷选购,涩米奇让购物无忧!涩米奇app介绍涩米奇----...
7.6/1,987.1M
MBA随身学是北京对啊网教育科技有限公司针对于MBA考试所设计的一款学习辅导软件;章节考点在线免费刷题;直播公开课专业名师讲解成功秘籍,课程视频用户可根据自己的...
9.3/212.6M
浊魔社区是一款拥有海量免费资源的社区软件,在这里大家能获取到各种自己想要的软件工具等,包括不同类型的游戏以及游戏辅助,甚至还能在这里学习各种技术,认识到有趣的朋...
陇上食安商户端app手机下载-陇上食安商户端V1.3.14 企业端
7.5/1,871.7M
陇上食安智慧餐饮,让大家少一份食品隐患,多一份生活平安。上架个体户或者是食品企业从业人员下载使用的APP,在这个APP上注册登录之后完善相关的资料,之后按照要求...
8.2/1,121.0M
绝地求生吃鸡小助手电脑版是一款绝地求生大逃杀游戏助手工具,方便玩家查询个人战绩,场次,吃鸡,总击杀都可以进行快速查询。绝地求生吃鸡工具绝地求生吃...
Buggy Backup Pro汉化下载-Buggy Backup Pro付费修改版26.0.0 最新中文版
9.0/1,052.3M
功能非常强大的一款国外数据备份软件,BuggyBackupPro是一个可以对Android设备中的应用程序进行备份、共享、管理的应用程序(无需root)。免费使...
8.6/104.6M
奇妙搜索播放器是一款可以搜索全网资源的播放器软件,除了全网视频资源以外,该软件还有海量应用工具、音乐、图片、网站等可以获取,感兴趣的朋友们快来uzzf东坡下载吧...
万圣节狂欢派对策划-万圣节狂欢派对活动策划方案ppt精美版免费下载
8.2/611.4M
今天是一个狂欢夜,大家快来狂欢吧。今天东坡小编为大家带来的是一份万圣节狂欢派对活动策划方案ppt,已经找到了好的策划方案的朋友们,但是还没用ppt模板的话,可以...
7.6/965.6M
2017重阳节广告海报设计PSD版是小编为大家收集的一套非常漂亮大气的重阳节宣传海报,可以让你在节日当天使用,作为广告也好宣传也好,需要的下载吧。2017重阳节...
八哥伪原创工具下载-八哥伪原创appv1.4.3 官方最新版
8.2/1,361.5M
八哥伪原创app是一个人工智能伪创作神器,一键智能改写、原创度高、十倍效率神器!简单好用的伪原创创作工具,复制搬运就是这么简单!八哥伪原创app介绍八哥伪原创工...
9.7/1,345.9M
掌阅科技官方出品的一款精选好书阅读软件,掌阅精选app这里有海量的精选推荐书库,支持不喜欢可退的模式,为用户带来沉浸式的阅读方式,专属的读书报告更好的记录和分享...
Pixel Ben Runner(像素人地铁跑酷)1.0 安卓版
7.6/1,522.8M
像素人地铁跑酷(SubwayBenPixelCraft)是一款快节奏3d跑酷游戏,采用地铁跑酷游戏模式,玩家需要滑动屏幕来让像素人躲避障碍物,到达目的地!像素人...
日历2017年6月日历表完整版下载-2017年6月日历表完美打印版excel版
7.9/1,153.9M
2017年6月日历表完美打印版支持单页打印也是支持多页一起免费的打印的,如果有需要的话现在就可以来免费的下载,同时也是有其它月份的日历表!2017年6月节日大全...