wordpress插入腾讯视频同层播放短代码

  • A+
所属分类:WordPress技巧
<video x5-video-player-type="h5" x5-video-player-fullscreen="true" x5-video-orientation="portrait" style="width: 100%;" controls="" src="视频地址"></video>

 

  • 腾讯视频短代码:
[qq-video vids=视频ID]

 

 

  • 腾讯去广告视频安装方法:

腾讯去广告视频功能需要将以下代码添加到主题页的functions/functions.php

function v_qq_video($atts, $content=null) {
extract(shortcode_atts(array("vids" => ''), $atts));
$url = 'https://vv.video.qq.com/getinfo?vids='.$vids.'&platform=101001&charge=0&otype=json';
$json = file_get_contents($url);
preg_match('/^QZOutputJson=(.*?);$/',$json,$json2);
$tempStr = json_decode($json2[1],true);
$vurl = 'https://ugcws.video.gtimg.com/'.$tempStr['vl']['vi'][0]['fn']."?vkey=".$tempStr['vl']['vi'][0]['fvkey'];
$video = '<video x5-video-player-type="h5" x5-video-player-fullscreen="true" x5-video-orientation="portrait" style="width: 100%;" controls src="'.$vurl.'" poster="https://puui.qpic.cn/qqvideo_ori/0/'.$vids.'_496_280/0"></video>';
return $video;
}
add_shortcode('qq-video', 'v_qq_video');

 

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: