Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 请帮我解析一下秒拍的解析视频代码,我要在网站中贴优酷和秒拍的视频?

[复制链接]
fhzbjxx 发表于 2016-7-10 13:41:26 | 显示全部楼层 |阅读模式
本帖最后由 fhzbjxx 于 2016-7-10 13:47 编辑

function openVideo(a,b) {
        $(a).html('<img src="static/image/mobile/images/icon_load.gif" />');
        var w = $(a).width();
        var h = w * 0.85;
        if(/youku/.test(b)){ //解析优酷
                b = b.match(/id_(.*?)\.html|sid\/(.*?)\/v/);
                b = 'Youku Universal Player' + (b[1] ? b[1] : b[2]);
        }else if(         .test(b)){ //解析秒拍

//秒拍参考
//浏览器地址:http://www.miaopai.com/show/qCC408GAsmPC~CIc-5G8iQ__.htm
//实际视频地址:http://gslb.miaopai.com/stream/qCC408GAsmPC~CIc-5G8iQ__.mp4

                b = b.match(                              );
                b = '                              ' + (b[1] ? b[1] : b[2]);
        }else{
                $(a).html('不支持此视频地址显示:' + b);
                return;
        }
        $(a).append('<iframe width=0 height=0 src="' + b + '" scrolling=no frameborder=0 allowfullscreen></iframe>');
        $(a).children('iframe').load(function(){
                $(a).children('img').remove();
                $(a).children('iframe').css({'width':w,'height':h});
        })
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 11:18 , Processed in 0.133083 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表