WordPress视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。
<?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插件安装方法]
Smartideo插件使用方法2345应用商店官方版下载-2345应用商店(2345手机助手)10.8 最新版
你可以直接粘贴视频播放也完整的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.0安卓版
闪电GIF制作软件下载-闪电GIF制作软件7.4.5.0 官方版
aegis安卓版下载-2fa验证器下载(Aegis)3.3.4 安卓版
阳光传奇合击下载-阳光传奇合击手游1.1.0 正版
点点机场管理员游戏下载-点点机场管理员游戏官方版2.80 安卓版
66学生版app下载-66学生版app1.0.1 苹果版
英语学霸V7.4 安卓版
白医(医学手册)软件下载-白医APP1.1.7安卓版
冒险异闻录免广告下载-冒险异闻录免广告版1.0.1 安卓版
热血三国无双4399游戏盒下载-4399热血三国无双1.0渠道服
天界修仙果盘下载-天界修仙果盘客户端1.0 官方版
金豆豆app下载-金豆豆app1.0.0 安卓版
wifi密码查看器去广告版免费下载-WiFi伴侣密码查看器1.5.1 安卓免费版
优图合同管理软件-优图客户端7.0 官网最新版
中原名校2017-2018学年第四次质量考评语文试题及参考答案doc免费下载
微信公众号长链接转短连接pc下载-微信公众号短链接生成器1.0.0.0免费版
9.2/600.5M
微信公众号短链接生成器是一款非常好用的短网址转化工具,能够帮助用户将微信公众号文章的长链接转换为永久短链接,方便用户进行转发分享,使用起来非常方便,有需要的用户...
9.1/1,715.3M
熊孩宝家长端是一款非常专业的儿童手机管控系统,可以给予孩子绿色的学习空间。熊孩宝家长端介绍熊孩宝是一款绿色安全可靠的儿童手机管控系统,提供了基于云端技术的SAA...
One More Time游戏下载-One More Time手游1.17.178 安卓官方版
9.0/903.4M
OneMoreTime手游是一款第三人称的射击游戏,3d高清的游戏画面,武器装备很丰富,还有独特的光影音效,个性化的英雄选择等等,带上你的宠物一起来一场高科技的...
熊猫博士小邮差下载-mailman熊猫博士小邮差老版本19.3.22 安卓版
9.3/625.3M
变身一名快乐的小邮差,探索一个由高山、房屋、河流和森林等组成的互动世界!熊猫博士小邮差是一款专为孩子匠心设计的游戏,开放式的游戏让孩子们用丰富的想象力讲述自己的...
微趣味vip视频解析下载-微趣味vip视频解析系统1.0 免费解析版
9.9/787.4M
微趣味vip视频解析系统是一款视频解析插件,也是vip视频解析播放器,直接解析出收费视频的播放地址,免广告免限制的看vip视频了。vip视频解析浏览器插件微趣味...
仙元天下至尊福利版下载-仙元天下至尊版2.41492至尊无敌版
8.2/1,612.3M
仙元天下至尊版以历史故事为背景题材的MMO游戏,玩家将通过每日的副本任务获取强力的装备和道具,给你助攻。仙元天下至尊版官方介绍为打造原版东方历史武侠玄幻的动作R...
7.9/1,804.5M
巴巴汇app是最近比较火的一款金服了,给大家提供最新的安卓版下载地址,这款金服在妇女节推出,各种送钱活动享不停,需要的理财的朋友快来下载吧,还能赚钱哦!巴巴汇a...
2018狗年日历app下载-2018狗年日历软件1.2 安卓手机版
7.7/492.6M
2018狗年日历app功能强大,同时也是免费的,可以直接的记录你需要记录的各种各样的事情,为你提供所有的节日日历需要的功能,非常的简单以及好用!2018狗年日历...
8.5/1,071.2M
放逐之城这个游戏名一开始可能都想不到它是款模拟类游戏,游戏内容大致就是放逐了一群人到了一地方,然后开始了建造城市慢慢发展的道路。放逐之城好玩吗放逐之城是一款非常...
早检测论文查重系统下载-早检测论文查重系统2.1.0 手机版
9.3/238.7M
早检测论文查重系统是一个非常好用的论文查重软件,上传论文文档点击开始检测,准确的数据对比,查看报告;你还在为论文而烦忧吗?赶快来下载吧!早检测论文查重系统介绍湖...
7.8/1,188.8M
新想视频app是一个最新推出的影视剧软件,里面资源非常丰富,分类明确,网友们可以轻松找到自己喜欢的剧集,支持投屏,非常好用,喜欢的朋友可以来下载使用!新想视频a...
8.0/285.7M
天灵剑传是一款经典角色仙侠手游,唯美的仙侠世界,浪漫的剧情故事情节,趣味的副本任务的加持,玩家自由的捏脸,海量丰富的玩法期待你的到来哦,哦对了还有福利等着你哦!...
2020年春节拜年快闪ppt下载-2020年春节拜年快闪ppt免费版
9.5/1,269.4M
2020年春节拜年快闪ppt,2020年鼠年已经到来了,小编在这里给大家准备了一些祝福语,抖音快闪祝福语非常的多,可以有不一样的祝福。2020年鼠年谐音祝福语2...
9.9/889.7M
洪恩数学是一款儿童数学学习软件,旨在通过有趣的游戏和生动的教学方式帮助孩子进行数学启蒙,培养数学思维。设置了各种综合性的数学问题和思维挑战,锻炼孩子的逻辑思维、...
方皮特的一夜惊魂三汉化版下载-方皮特的一夜惊魂三汉化版(One Night at Flumptys 3)1.1.3 安卓版
8.2/1,081.6M
方皮特的一夜惊魂三最新版本终于上线啦,而且该版本还是汉化之后的版本,在游戏中,玩家将被困在密室,你需要想尽办法在密室中寻找线索,玩起来很刺激,感兴趣的小伙伴快来...
xp-AntiSpy(XP 反间谍)绿色汉化版 V3.97-8 Final
7.6/1,532.3M
在使用WindowsXP时会发现有很多需要系统自动连接网络的时候,这些是不是很安全的,虽然微软件说是不会收集个人的信息,只是收集电脑所要求的请求,可以不可以把这...
9.8/807.4M
饿了么点外卖app该app是一款全球最最最专业的外卖订餐软件,它能够全方位满足您的食欲,美食包括中餐、西餐、快餐、火锅、下午茶、甜点、水果生鲜、鲜花蛋糕等等而且...
7.5/416.6M
拌合站租赁合同是一份关于关于混凝土拌合站的租赁合同,根据合同法指定,一共有12条条款,责任明确,签署后具有法律效力。拌合站租赁合同条款第一条:设备名称、型号、规...
9.0/176.8M
奇兔刷机是一款无需繁琐刷机教程,简单为您的手机一键刷机,海量官方ROM刷机包任您选择,一键刷机工具下载,真正刷机小白也能刷机的神奇软件。奇兔刷机recovery...
my new teachers课件-Unit1 My New Teachers第三课时ppt课件免费版【人教版五年级上册英语】
8.2/978.2M
《Unit1MyNewTeachers第三课时》主要是学习Pronunciation,引导学生拼读这个单词,注意发音规律,能熟练使用“He’stallandth...
查看
部落大冒险游戏下载-Sterve.io(部落大冒险io游戏)1.0 安卓版
7.6/1,000.8M
部落大冒险是一款io题材的休闲游戏,游戏的主要玩法就是吞噬别人,占领别人地盘,变大才能更好的生存下去,你能够在游戏中活多久呢?部落大冒险io游戏特色1、操作简单...
python3.7.2下载-Python 3.7.2 正式版免费下载【32&64】
7.9/812.9M
Python3.7正式版已经发布了,全球最受欢迎的编程语言之一,随着人工智能的发展,pyhton语言受到了越来越多的大企业的关注,这款简单而又强大的编程语言让开...
鬼语迷城变态版下载-鬼语迷城bt版5.46.284.416.0gm版
9.5/967.3M
一款盗墓冒险题材的手机游戏,魔幻冒险风格,探险远古遗迹,玩家可以选择一个自己喜欢的职业,组成一个小队,团队探寻上古宝藏,在团队中发挥不可或缺的中坚力量!鬼语迷城...
7.6/1,193.5M
环球商家是一款实用的汽车保养app,用户可以直接通过线上查询门店之后,然后通过平台内部下订单,提供服务内容包括洗车店、汽车美容店、汽车保养等一系列常见汽车服务,...