
类型: 教育学习 版本: V6.3
大小: 1,999.8 时间: 2025-11-21





<?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插件安装方法]
在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
WordPress视频播放插件(Smartideo)安装方法
你可以在后台插件管理页面中直接搜索Smartideo并安装.

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

2021烟酒店赚钱吗
634.4M
抖音你在无中生有暗度陈仓是最近一款非常火的软件,非常多的人想要这款表情包,小编给大家整理了这款表情。抖音你在无中生有暗度陈仓是什么歌这不是一首歌,无中生有暗度陈...
每天赚一百元的方法
1,233.2M
序列号:QWYX8RY86X4K8DMB8R43Y39QC序列号:J9Q7HKPXXTV48YDGWVK72T6BJ 方法:复制序列号&rar...
cf刷级能赚钱吗
1,415.5M
奇奇百度SEO优化软件是一款强大的搜索引擎关键词优化工具,主要采用了全新的智能云优化技术,可以帮助用户迅速优化百度、谷歌、搜狗、搜搜、雅虎、有道、必应等搜索引擎...
湖州兼职网南太湖
1,165.1M
大家或许会有这样的感悟,就是平常在网上下载专业软件之后,总会有一些权限让大家不能够使用,这样情况下最好还是选择迅腾脱壳破解工具包,通过它可以在里面找到很多破解的...
现今免费赚钱路子
467.9M
天启圣源官方正版是网易新出的一个mmorpg手游大作,人宠合作战斗体系,休闲的Q版美术风格,经典的职业,精美的画风,丰富的跨服玩法,很不错!值得一玩!天启圣源资...
虎牙直播赚钱攻略
1,586.3M
TL-SF1006P是一款以太网交换机,对于TL-SF1006P安装不是很懂的朋友可以来东坡下载这份TL-SF1006P安装说明书,有详细的图文操作方法,需要的...
抖音刷赞 赚钱
1,961.3M
腾图屏幕锁是一款绿色小巧的电脑屏幕锁软件,同其他屏幕锁软件一样,它能锁定当前屏幕,保护你的电脑安全,不允许其他人乱碰你的电脑,只有输入密码才能重新激活屏幕,新加...
兼职社交软件排行
632.3M
AdobeMediaEncoder2022是一款功能强大的音频、视频转码工具,收录、转码、创建代理和输出您可以想象的几乎任何格式。使用预设、WatchFolde...
杭州棋牌公司贝抓
1,007.9M
泰捷视频港台节目源涵盖了所有的港澳台的电视台,有喜欢看这两个地方界目的朋友,现在就可以来东坡免费的下载这些泰捷视频港台节目源,还有最新的安装教程!泰捷视频港台节...
奔驰宝马注册送35
346.3M
九月如期而至——这也就意味着离教师节不远了,相信不少朋友已经开始筹划与教师节有关的“活动”什么的了——比如说教师节手抄报啦!教师节ppt课件啦等等,以此向受人尊...
美嘛上面的兼职靠谱吗
365.2M
K/3WISE物料批次调整是一款功能强大的调整物料批次的软件,使用该功能首先需要购买云盾服务,可点击该文档中【购买链接】,直接购买云盾服务。软件介绍K/3WIS...
投资公司工作挣钱多吗
602.1M
中国鞋业网是中国鞋子行业专业鞋网、是鞋子批发贸易首选网站.提供鞋子批发、品牌招商、鞋样设计、采购加工、鞋业新闻、鞋业展会等一条龙服务的鞋网。找鞋业就找中国鞋业网...
黄石兼职
1,938.7M
旭荣提醒记事本具有定时提醒和记事本功能,您可以通过它记录会议提醒、约会提醒、日程提醒等,让你绝不错过任何一场约会,支持自动弹出提醒窗口,相当于多了一个日程提醒小...
电影票优惠券变现
1,149.4M
这是一个专业的骑行导航软件,很多喜欢骑行摩托车自行车的用户都在使用,功能十分强大,帮助你设置各种导航,还有多种来电提醒等等功能,一键搜索地图位置!思骑出行软件介...
漏洞赚钱项目
1,554.7M
科羽职业技术学校招生管理系统是一款专为职业学院打造的管理软件,能帮助用户统计各种数据,包括学生咨询、报名、招生老师等等,智能化信息录入,操作便捷,能有效提高工作...
致富网小投资项目机
2025/11/20 03:06
325棋牌能赢
2025/11/14 13:37
全城兼职
2025/11/22 15:50
q币怎么提现视频
2025/11/16 23:31
自己的网站怎么赚钱吗
2025/11/19 00:42
889棋牌客服
2025/11/13 23:49
开白酒专卖店挣钱吗
2025/11/17 19:54
鞍山在家做手工兼职
2025/11/21 22:24
录快手视频怎么赚钱吗
2025/11/09 12:26
真人注册送白菜平台
2025/11/12 14:19
做生意赚点钱又进货
2025/11/10 21:55
易鑫棋牌
2025/11/12 23:31
淘宝直播能不能赚钱
2025/11/06 11:01
跟庄炒股稳赚
2025/11/11 23:54
大众棋牌李逵劈鱼
2025/11/13 16:35
大众棋牌李逵劈鱼
2025/11/13 16:35更新
“从被爱打扰的日子说开去”——听起来很美好很文艺很有爱有木有?但小编要说的是这是一份中学生早恋主题班会课件ppt的题目——没错!就是你看到的这份ppt课件(以下...
支持 ( 33 ) 盖楼(回复)
支持 ( 54 ) 盖楼(回复)
支持 ( 85 ) 盖楼(回复)
支持 ( 135 ) 盖楼(回复)
支持 ( 69 ) 盖楼(回复)
支持 ( 87 ) 盖楼(回复)
支持 ( 21 ) 盖楼(回复)
支持 ( 52 ) 盖楼(回复)
支持 ( 149 ) 盖楼(回复)
支持 ( 104 ) 盖楼(回复)
支持 ( 122 ) 盖楼(回复)
支持 ( 43 ) 盖楼(回复)
支持 ( 141 ) 盖楼(回复)
支持 ( 41 ) 盖楼(回复)
支持 ( 135 ) 盖楼(回复)
支持 ( 100 ) 盖楼(回复)
支持 ( 166 ) 盖楼(回复)
支持 ( 98 ) 盖楼(回复)
支持 ( 148 ) 盖楼(回复)
支持 ( 184 ) 盖楼(回复)