[WordPress插件怎样安装WordPress插件安装方法]
在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
<?php趣转转手机赚钱app
/*
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.

展开内容
8.5/830.3M
爱饭行程是一款全新推出的手机做饭软件。这里包含了很多地方的美味菜谱,让你学习怎么做一道美味的家乡菜。多种功能可以选择,一键搜索全国的美食,快速的学会做饭,挑战自...
8.3/143.1M
花花僵尸微伞小游戏是一款卡通q萌的休闲手游,游戏中玩家种植各种植物,击败来袭的僵尸,玩法和植物大战僵尸超不多,但难度减低了,感兴趣的小伙伴快来东坡下载吧!花花僵...
7.5/1,841.9M
烽火枭雄手游是一款三国战略SLG手游,真实还原三国名将,等你统领千军,指点江山,将这三国收入囊中!开局选州六选一,快来加入你喜欢的势力,热血争霸三国战场!新手礼...
8.0/1,181.4M
完美钢琴电脑版是一款免费的的钢琴键盘模拟器。使用真实的钢琴声音,你可以使用这个应用程序,准确地学习钢琴。内含多首钢琴曲谱供您练习,并且在不断更新,希望能在你练习...
8.7/1,651.8M
人力随身学方面的问题或者是需要考试以及试题的,可以使用对啊人力随身学app,这里包含历年的考试试题以及名师为你提供一对一的服务!对啊人力随身学介绍我们全都有!晋...
7.8/1,274.9M
2017母亲节已经快要来了!现在为大家带来2017母亲节手绘海报海报素材,可以帮助你快速的学习使用,让你在母亲节的时候更加快乐!2017母亲节手绘海报素材预览预...
8.6/303.1M
这款游戏是一款非常好玩的打击犯罪游戏,在游戏中可以依靠手中的武器保护城市,游戏中有着很多邪恶的人,你需要用技巧去战胜一个个强敌,让游戏玩起来十分带感!城市蜘蛛人...
7.6/639.6M
拼立得美图是一款能够让你的照片一秒变得和海报一样炫目,支持多种照片风格,每个不一样的你,都惊艳了岁月。一键发送到空间,让大家与你分享着精彩的一瞬间。让照片瞬间像...
9.0/37.2M
AVIFixed是一款小巧免费的avi视频文件修复工具,能够帮助用户快速的对电脑本地的avi视频文件进行一个全面的修复!主要是用来修复不完整的Divx电影片段,...
9.9/147.6M
笃行抽签抽奖软件是专为企业比赛抽签或者抽奖用的软件,界面美观,可以自定义背景和奖项,还支持内定中奖人员,是非常智能人性化的一款抽奖软件。笃行抽签抽奖软件功能介绍...
9.0/1,195.9M
京东旗下的京客服兼职app,京东官方兼职无忧,京东官方发布,严格岗位审核,正规渠道保障。如果你想要在闲暇时间找客服兼职,且拥有电脑打字办公的条件的话就可以来这里...
9.2/1,735.7M
高考即将到来,许多朋友都在准备参加高考了,小编带来了高考励志正能量句子大全,可以用来发微信朋友圈,帮朋友们加油打气!高考励志正能量句子大全河北高考改革最新消息选...
8.0/520.0M
玩转手机中三国经营类的游戏,就属勇将最好玩,最有意思了,而且游戏的界面做的还很不错哦!喜欢玩三国游戏的朋友就赶快来玩玩吧,不要在错过了这么好玩的三国游戏!游戏介...
7.9/1,286.3M
造梦西游OL手机版是由4399游戏运营的造梦西游系列的移动端游戏。游戏人物画面精致Q萌,游戏画面流畅,技能效果明显。玩家将在游戏中扮演斩妖除魔拯救三界的重要角色...
8.1/72.1M
泡打三国H5是一款微端传奇游戏,在游戏中,继承了传奇的经典玩法,三国的题材,独特的战法,宏伟的地图,让玩家满世界征战自由的交易,自由的恋爱,自由的战斗,设么都是...
9.6/1,518.8M
抽烟模拟器是可以免费的模拟你虚拟的电子烟,建议有需要或者是恶搞的用户都是可以免费的下载使用,也是可以在很多的场合里面免费的为你提供的一些需求!吸烟模拟器软件介绍...
8.5/929.6M
汉风西游ol游戏包是一款有着复古风格的西游冒险游戏,冒险+战斗的玩法,Q萌的人物造型、精致的画面、风格迥异的场景,加上战斗界面的简洁明了,绚丽的技能特效,游戏亮...
9.3/1,199.6M
G3通话是中国移动提供的网络语音通话服务,目前该业务仅限于广东省内的移动用户才能使用,外省用户暂时无法使用。G3通话主要特色:显示真实号码,通话更安全!使用G3...
8.9/41.1M
江西国资安监app是一款专业的施工项目管理办公软件,无论是施工日期、施工进度以及施工流程等等,在软件里统统都可以查看到,提供安全教育培训服务,可以解答各种问题!...
8.7/918.4M
营口行苹果客户端是专门针对营口推出来的一款掌上智能公交路线查询软件,为你提供最新的交通信息、交通路线、公交到站情况,欢迎有需要的朋友前来东坡下载使用。营口行苹果...
8.8/429.4M
荒芜星球汉化补丁可以帮助那些喜欢这款游戏但是又不会外语的玩家,荒芜星球是一款外太空主题的生存冒险游戏,游戏画面和剧情都很有新意,这里给大家分享荒芜星球汉化补丁,...
7.9/333.6M
打工人日记是一款模拟打工人游戏,安排你的各种碎片时间,合理放置相应的行动卡牌,让你的生活更加丰富多彩,并让你的收益最大化。在打工人日记中,从基层打工人开始奋斗,...
7.8/1,234.8M
小浣熊IOS启动器(浣熊iOS15启动器)可以让安卓手机仿ios手机系统,就是让安卓手机体验苹果手机的感觉,直接安装本软件然后切换一下系统就可以了,很简单的。小...
9.2/1,886.0M
赛车追击战是一款非常有趣的赛车赛车游戏,在各种轨道上进行比赛和追逐战。游戏玩法简单,要求玩家在赛道上尽可能超越对手,避免撞到其他车辆和障碍物。至尊极速狂飙游戏介...
9.0/1,350.1M
蓝魅最新版apk已经更新到了9.9版本,这也是目前全网能提供的最新版本了。超丰富资源免费看,各类电影电视剧轻松借宿,还内置十几个平台的入口,轻松观看超多平台资源...