[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
<?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>';
}
}
展开内容
8.8/1,421.2M
一款以猫咪为主题的休闲游戏,小猫地道奔跑手游中,你将和可爱的猫咪一起穿越重重障碍,收集途中的红钻石,在遇到阻碍时能及时反映过来,你能帮助小猫坚持多久呢?游戏特色...
9.5/1,970.7M
真实欧洲卡车模拟是真正的大制作,模拟车辆驾驶,遨游于城市之间,展开奇妙冒险。宛如真实的3D街道,跌宕起伏的驾驶路线,还有各种运输任务,玩起来相当给力。来选择一款...
7.6/1,571.8M
百科识图王-一款可以协助你认识各种景物,人物,食物,电子产品等多功能的APP百科识图王app功能[人物识别]-无论是电影中的人物还是网络上的人物,上传即可识别T...
8.1/1,055.5M
梦言小伟bmw宝马在线是一款可以让你qq显示宝马在线的软件,操作简单,登录qq即可显示,让你成为有“宝马”一族,让别人羡慕去吧。梦言小伟bmw宝马在线(梦言小伟...
7.9/828.7M
普拉达流行PixiPop是一款好玩的休闲游戏,玩家需要帮助小精灵保护森林,大白黑夜,利用你的技能消灭敌人,不能被小球撞击,一旦碰上就会失败,好好利用你的技能吧!...
9.1/862.1M
作为一款一站式综合服务app,可以了解购车活动、预约试驾等服务。一汽马自达购车助手更多实用工具和展示等你来体验。为潜在用户及已购车用户提供最新最全的一汽马自达相...
9.5/517.4M
汪汪快app是一款掌上同城配送应用。汪汪快app主要为用户提供专业的配送服务,支持在线下单,同城取送等功能,使你获得优质的配送服务体验,让您可以随时随地吃遍全城...
查看
9.1/830.6M
月如钩锁清秋手游剧情、画面、元素等都非常的贴近真实的古代宫廷生活,大量的服饰、饰品、妆容等,都可以增加角色的妆容,能够展现出强大的杀伤效果,吸引皇帝的注意力,轻...
8.5/104.7M
密探Ruiner这款好玩的射击类游戏,相信不少人都是喜欢玩的,现在为大家带来密探Ruiner生命修改器可以直接的修改游戏数据,密探Ruiner有着非常经典的玩法...
9.8/1,754.2M
聊吗视频会议app是一个精品视频会议软件,有需求的朋友可以通过这个软件来开展视频会议,跨越空间,直接沟通,开会更方便!软件介绍一款为商务人士量身打造的免费视频会...
9.4/1,527.3M
下坡第一次旅行是一款休闲益智类手机游戏,游戏共有二十多个关关卡供玩家来体验。顽疾将在游戏种穿越美丽的风景来到非常危险的地方收集水晶。游戏画面精美,前提能够克服接...
7.9/1,368.3M
ETV是一款强大的视频编辑软件,它的强大来源于轻松录制多项媒体资源,将他们整合成视频,而且还能直播,非常的不错,欢迎大家下载使用。软件介绍 Etvbook视频...
8.0/1,253.8M
速联WiFiapp是一款非常优质的手机线上WiFi连接软件,用户下载这款软件就能够了解到自己WiFi的所有信息,app上涵盖的功能也是非常的丰富,用户可以根据自...
9.8/46.8M
赣州配送网是一款生物类软件,在赣州你可以使用赣州配送网查看众多的配送信息,你可以使用你的包裹选择各种服务,感兴趣的可以看看哦!赣州配送网介绍赣州配送网是赣州一款...
9.6/1,160.3M
其实这里是一款手游一站式代理平台,也就是说这个平台其实最主要的目的是找加盟商,需要你推广这个平台,也算是销售了,这个软件盒子是有很多游戏资源的,玩家可以在线找到...
7.7/1,766.5M
简单的冒险手游,在这里你需要逃出这个建筑,这是发生在放学之后的故事,所以是没有其他人的,你需要宣召可以帮助你的一切事物,要是,线索,武器...等等,注意,不要被...
10.0/407.2M
玉米工作室“新鲜出炉”游戏,星球美食塔,第一款像素风游戏,吃货王子白手起家,创建自己的美食帝国!通天美食塔,用美食征服全宇宙!游戏简介《星球美食塔》是由玉米游戏...
8.8/126.7M
圆梦新征程app是干嘛的?圆梦新征程app是一款在线学习答题软件,为弘扬万里长征的精神,通过此软件中的各项题目能够亲身的体验万里征途,全民答题,提升自身的知识水...
8.1/370.9M
医大帮学医软件是一让从医人员快速的与同行学习的一个平台,相当于会诊,这样可以快速的提高自己的医术水平。医术提高需要耐得寂寞,睡在病房,不断查看患者和书籍,反省、...
9.3/1,386.4M
吉林省人民政府苹果版是一款专门为吉林用户打造的政府相关app应用,用户在手机端即可了解最新的吉林信息,政府动态、以及城市建设和政务信息,欢迎感兴趣的朋友前来东坡...
9.4/1,635.1M
末日手游限时活动来临,上线就可得虫群女王,末日手游限时活动来临,上线就可得虫群女王,不肝不氪轻松当大佬游戏中还有多样有趣的副本供你探索。同时也提供多样的装备、武...
8.4/704.0M
好货圈app是一个全新的购物商城软件,用户可以通过软件挑选优质好货,还有限时抢购活动,超多的优惠劵!软件介绍好货圈是一个全球精选的会员制电商平台,通过社交渠道让...
9.3/1,617.6M
一款幼儿体能教育软件,小飞蛙app针对幼儿的特点打造的了精品课程,有篮球、滑轮、体能课等,增强幼儿的体质,快乐健康的成长。小飞蛙官方介绍成都小飞蛙教育科技有限公...
7.9/1,467.7M
钓鱼锦标赛游戏是一款非常好玩的钓鱼类型的游戏,游戏中你可以模拟出钓鱼的玩法,可以使用真实的钓鱼器具进行钓鱼,通过你的钓鱼技巧爽快的进行操作!钓鱼锦标赛游戏破解说...