在wordpress上播放在線視頻要怎么設(shè)置呢?有了這款Smartideo視頻插件就簡單多了,它可以幫助你快速在wordpress添加在線視頻,支持手機(jī)、平板的HTML5播放,它支持優(yōu)酷、搜狐視頻、土豆、56、騰訊視頻、新浪視頻、酷6、華數(shù)、樂視 等熱門網(wǎng)站的視頻。
WordPress 視頻播放插件 Smartideo怎么安裝
WordPress 視頻播放插件(Smartideo)安裝方法
你可以在后臺(tái)插件管理頁面中直接搜索 Smartideo 并安裝.

或者上傳文件夾 smartideo 至 /wp-content/plugins/ 目錄.
在插件管理頁面中激活 Smartideo.

WordPress 視頻播放插件(Smartideo)怎么用
Smartideo插件使用方法
你可以直接粘貼視頻播放也完整的URL到編輯器(單獨(dú)一行),就可以加載視頻播放器。
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插件代碼預(yù)覽
<?php
/*
Plugin Name: Smartideo
Plugin URI: http://www.fengziliu.com/
Description: Smartideo 是為 WordPress 添加對(duì)在線視頻支持的一款插件(支持手機(jī)、平板等設(shè)備HTML5播放)。 目前支持優(yōu)酷、搜狐視頻、土豆、56、騰訊視頻、新浪視頻、酷6、華數(shù)、樂視 等網(wǎng)站。
Version: 1.2
Author: Fens Liu
Author URI: 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 = new smartideo();
class smartideo{
private $width = '100%';
private $height = '500';
private $mobile_width = '100%';
private $mobile_height = '250';
public function __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') );
}
public function smartideo_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");
}
return apply_filters( 'embed_tudou', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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");
}
return apply_filters( 'embed_56', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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");
}
return apply_filters( 'embed_youku', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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']}");
}
return apply_filters( 'embed_qq', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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");
}
return apply_filters( 'embed_sohu', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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");
}
return apply_filters( 'embed_wasu', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_embed_handler_yinyuetai( $matches, $attr, $url, $rawattr ){
$embed = $this->get_embed("http://player.yinyuetai.com/video/player/{$matches['video_id']}/v_0.swf");
return apply_filters( 'embed_yinyuetai', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_embed_handler_ku6( $matches, $attr, $url, $rawattr ){
$embed = $this->get_embed("http://player.ku6.com/refer/{$matches['video_id']}/v.swf");
return apply_filters( 'embed_ku6', $embed, $matches, $attr, $url, $rawattr );
}
public function smartideo_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");
return apply_filters( 'embed_letv', $embed, $matches, $attr, $url, $rawattr );
}
private function get_embed($url){
$embed = sprintf(
'<embed src="%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;
}
private function get_iframe($url){
$iframe = sprintf(
'<iframe src="%1$s" width="%2$s" height="%3$s" frameborder="0" allowfullscreen="true"></iframe>',
$url, $this->mobile_width, $this->mobile_height);
return $iframe;
}
public function admin_menu(){
add_plugins_page('Smartideo 設(shè)置', 'Smartideo 設(shè)置', 'manage_options', 'smartideo_settings', array($this, 'admin_settings'));
}
public function admin_settings(){
if($_POST['smartideo_submit'] == '保存'){
$param = array('width', 'height', 'mobile_width', 'mobile_height');
$json = array();
foreach($_POST as $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 設(shè)置</h2>';
echo '<form action="" method="post">
<table class="form-table">
<tr valign="top">
<th scope="row">播放器寬度</th>
<td>
<label><input type="text" class="regular-text code" name="width" value="'.$option['width'].'"></label>
<br />
<p class="description">默認(rèn)寬度為100%</p>
</td>
</tr>
<tr valign="top">
<th scope="row">播放器高度</th>
<td>
<label><input type="text" class="regular-text code" name="height" value="'.$option['height'].'"></label>
<br />
<p class="description">默認(rèn)高度為500px</p>
</td>
</tr>
<tr valign="top">
<th scope="row">移動(dòng)設(shè)備播放器寬度</th>
<td>
<label><input type="text" class="regular-text code" name="mobile_width" value="'.$option['mobile_width'].'"></label>
<br />
<p class="description">手機(jī)、平板等設(shè)備訪問時(shí),默認(rèn)寬度為100%</p>
</td>
</tr>
<tr valign="top">
<th scope="row">移動(dòng)設(shè)備播放器高度</th>
<td>
<label><input type="text" class="regular-text code" name="mobile_height" value="'.$option['mobile_height'].'"></label>
<br />
<p class="description">手機(jī)、平板等設(shè)備訪問時(shí),默認(rèn)高度為250px</p>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="smartideo_submit" id="submit" class="button-primary" value="保存"></p>
</form>';
}
}
WordPress插件安裝方法
[ WordPress插件怎樣安裝 WordPress插件安裝方法 ]
- PC官方版
- 安卓官方手機(jī)版
- IOS官方手機(jī)版















三星GalaxyZFlip5國行版F7310ZCS7FYK2官方固件F7310ZCS7FYK2
三星GalaxyTabS9Ultra韓版X910XXS5DYJ2官方固件X910XXS5DYJ2
三星GalaxyS22+國行版S9060ZCS9GYK3官方固件S9060ZCS9GYK3
三星GalaxyTabS8+5G國行版X806CZCU9EYJ4官方固件X806CZCU9EYJ4
三星GalaxyTabA8港版X200XXS6DYG6官方固件X200XXS6DYG6
TCL電視V8-MS600TD-LF1V012版本強(qiáng)刷降級(jí)包固件LF1V012 中文版
TCL電視V8-MS600TA-LF1V040版本主程序降級(jí)包固件LF1V040 中文版
TCL電視V8-MS600TA-LF1V039版本強(qiáng)刷降級(jí)包固件LF1V039 中文版
TCL電視V8-A972T01-LF1V396版本主程序升-級(jí)包固件LF1V396 中文版
TCL電視V8-A972T01-LF1V093版本主程序降級(jí)包固件LF1V093 中文版
小米電視4A40寸/43寸小米電視4S43寸小米全面屏電視43寸2849固件v1.3.85 中文版
TCL電視V8-A962T04-LF1V035版本主程序降級(jí)包固件LF1V035 中文版
TCL電視V8-0MS9904-LF1V089版本強(qiáng)刷降級(jí)包固件LF1V089 中文版
TCL電視V8-A962T04-LF1V117版本主程序升-級(jí)包固件LF1V117 中文版
TCL電視V8-0MT25H1-LF1V023版本強(qiáng)刷降級(jí)包固件LF1V023 中文版
TCL電視V8-0M-T55TC-LF1V207版本強(qiáng)刷升-級(jí)包固件0M-T-55TC 中文版
TCL電視V8-0MS9906-LF1V016版本強(qiáng)刷降級(jí)包固件LF1V016 中文版
TCL電視V8-0M-T-55TC-LF1V850版本強(qiáng)刷升-級(jí)包固件0M-T-55TC 中文版
TCL電視V8-0M-T55TD-LF1V035版本強(qiáng)刷降級(jí)包固件LF1V035 中文版
TCL電視V8-0M-T55TD-LF1V951版本強(qiáng)刷升-級(jí)包固件LF1V951 中文版
TCL電視V8-0M-T55TD-LF1V035版本主程序降級(jí)包固件LF1V035 中文版
樂播投屏電腦版5.2.22.0 最新免費(fèi)版
知意配音電腦版3.4.81 官方版
酷狗直播伴侶6.78.3.780 官方正式版
錄音啦windows旗艦版13.1 官方正式版
斗魚直播管家1.2.11.0 官方pc版
企鵝電競直播助手2.29.335.15 官網(wǎng)最新版【主播必備】
半島音頻音效助手1.0 免費(fèi)版





57款potplayer皮膚包免費(fèi)下載
音悅臺(tái)mv下載(音悅臺(tái)MV批量解析)2.0 綠色免
楓葉SWF轉(zhuǎn)換器12.2.6.0 最新版
凡凡講述人1.0 win7綠色版【附使用教程】
文字播音軟件(文字播音員)2.9 綠色免費(fèi)版
adobe audition cc綠色中文版6.0.732 免安裝
影樓MV數(shù)碼電子相冊(cè)2019影樓版
Win10創(chuàng)造者更新15014多國語音包大全32位/6
飛轉(zhuǎn)文字轉(zhuǎn)語音軟件1.7.9 最新版
創(chuàng)新聲卡KX音效精靈2.2 破解版+注冊(cè)機(jī)