
类型: 美妆护肤 版本: V5.1
大小: 470.8 时间: 2025-11-22





<?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>';
}
}
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)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

[WordPress插件怎样安装WordPress插件安装方法]
在wordpress上播放在线视频要怎么设置呢?有了这款Smartideo视频插件就简单多了,它可以帮助你快速在wordpress添加在线视频,支持手机、平板的HTML5播放,它支持优酷、搜狐视频、土豆、56、腾讯视频、新浪视频、酷6、华数、乐视等热门网站的视频。兼职工作抓娃娃机
棋牌种类多的棋牌
1,921.7M
复仇者大战是一款好玩的动作战斗冒险小游戏,召唤更多的士兵不断地与来袭的敌人进行激烈的战斗,击败一波又一波的敌人,游戏打击感很强,操作起来超级爽快!复仇者大战游戏...
抢庄牛牛手机提现失败
389.1M
植物大战僵尸英文版是最初代版本的植物大战僵尸,拥有更好的游戏画面和游戏体验,此版本带花园面谷歌,下载注册即可畅玩,有感兴趣的小伙伴快来东坡下载吧。植物大战僵尸英...
兼职试衣模特怎么样
1,452.4M
它是少数几个开源AndroidGBA模拟器之一,因此可以定期进行更新。这里已经是汉化过后的版本了,大家可以放心使用,而且这个模拟器还自带一个游戏,大家也可以试玩...
冰雪王座搬砖赚钱
1,077.0M
瞄准实验室是一款关于射击的辅助软件,在这里用户能训练自己的枪法,使你在第一人称枪战游戏中发挥的更加出色,各种训练模式能有效提升用户的精准度和反应力,感兴趣的朋友...
盛世棋牌官网在哪里
95.4M
聊天中发一些表情能增加聊天中的趣味性,小编带来的鬼畜表情app是一款拥有海量热门表情库的聊天必备表情包软件,这里精选了网上最新潮最热门、最逗、最鬼畜的表情,还能...
外汇公司怎么赚钱
1,389.4M
我和绵羊的交换日记读后感是一篇网络上非常优秀的读后感范文,有的同学不知道作文要怎么写,东坡为大家提供了一个学习的范文!范文预览王力芹编著的《我和绵羊的交换日记》...
金德大宗能提现吗
1,290.7M
计算机专业的学生和喜欢软件逆向工程的爱好者都知道,浮点数在计算机内部是采用十六进制的方式存储的。采用的是IEEE二进位浮点数算术标准(IEEE754),为许多C...
女人有什么办法挣钱快
1,008.1M
经典传奇手游,装备全靠打,爆率9.9,散人也能霸服!经典传奇手游,不肝不氪,爆率全开,装备靠打,自由交易!大家可以在复古的游戏画风中体验传奇战斗,游戏中的玩法模...
变现收益纳税计算公式
234.7M
花瓣网图片下载脚本,可以通过这个脚本在花瓣网下载自己所需要的图片,全部都是免费的,小编还会给大家提供安装教程,跟着这个教程就可以下载到自己所需要的东西。目前功能...
网页游戏真的赚钱吗
528.2M
RUSH邮件软件是一款电子邮件助手工具,支持邮件管理和邮件群发,还可以管理邮件模板和任务管理,小编这里附上RUSH邮件软件电脑版免费下载,安装后就能使用。RUS...
久久丫鸭脖加盟挣钱吗
266.1M
现在快闪视频很流行,在一些短视频,广告上都可以看到,快闪文字制作器app就是一款文字动画制作神器,编辑个性的文字,够将语音转变成视频。功能介绍使用AI黑科技,准...
西安大学生兼职家教
1,604.8M
金魔仆手机版是一款非常实用的金融理财学习软件,它包含了海量的金融知识,用户可以随时随地查询知识课程,提升用户的职业素养,这里还可以让用户学习到最全面的行业大数据...
兼职社会实践活动
383.5M
LG手机查询器(手机信息查看工具)是一款专为LG手机推出的手机信息查看工具,手动输入IMEI序号或者手机型号就可以查看手机的详细信息,例如型号、日期、最新系统等...
斗牛赢现金能提现平台
821.5M
小暮色喊麦音效软件为你提供了数十种音效,操作简单,非常适合QT、YY、IS等语音聊天室使用,主持人喊麦必备的软件,帮助你活跃气氛、炒热现场,语音主持更加生动有趣...
大力问问兼职答题
1,328.2M
萤石C2mini智能app是可以让你完成和智能设备对接的软件,而且还可以让你每天都可以看见自己的摄像头范围的情况,无论身在何地都可以智能链接,需要的下载吧。萤石...
赚钱儿下载
2025/11/05 12:02
怎么开好私人影院赚钱
2025/11/06 17:30
138棋牌苹果版下载
2025/11/14 15:24
玩消消乐真的能提现吗
2025/11/16 07:29
在家挣钱小作坊
2025/11/17 05:50
兰州大学生兼职约炮
2025/11/21 09:43
西元棋牌大全
2025/11/14 15:25
为了赚钱心酸的句子
2025/11/08 08:32
玩游戏赚钱可qq提现
2025/11/11 06:01
股票投1000能能赚多少钱
2025/11/09 00:00
在家兼职手工活钻石画
2025/11/19 18:29
友发628棋牌官方网站
2025/11/14 10:00
素质拓展挣钱游戏
2025/11/16 17:11
冰山集团能挣外快不
2025/11/19 08:44
加盟快递赚钱嘛
2025/11/06 15:57
加盟快递赚钱嘛
2025/11/06 15:57更新
配适音乐是一款操作简便的音乐播放软件,提供海量音乐资源。用户可通过搜索功能按歌曲名或歌手查找音乐,也能根据关键词在歌单中快速找到目标歌曲(如助眠、抖音热歌等),...
支持 ( 83 ) 盖楼(回复)
支持 ( 67 ) 盖楼(回复)
支持 ( 76 ) 盖楼(回复)
支持 ( 179 ) 盖楼(回复)
支持 ( 44 ) 盖楼(回复)
支持 ( 48 ) 盖楼(回复)
支持 ( 101 ) 盖楼(回复)
支持 ( 68 ) 盖楼(回复)
支持 ( 42 ) 盖楼(回复)
支持 ( 130 ) 盖楼(回复)
支持 ( 102 ) 盖楼(回复)
支持 ( 18 ) 盖楼(回复)
支持 ( 199 ) 盖楼(回复)
支持 ( 139 ) 盖楼(回复)
支持 ( 18 ) 盖楼(回复)
支持 ( 123 ) 盖楼(回复)
支持 ( 134 ) 盖楼(回复)
支持 ( 73 ) 盖楼(回复)
支持 ( 153 ) 盖楼(回复)
支持 ( 141 ) 盖楼(回复)