百度音乐盒免费试听超高音质音乐

  • 2013-03-18
  • 0
  • 35

           执行代码前:

           

           执行代码后:

           

           特意从缓存中把音乐文件取出 确实是320kbps的高品质音乐

           

           代码:

var x=new HQView(),HQMode=2,
realTimeSwitch = _.bind(function() {
        var id = x.listCtrl.get("playlistReference").getListId(),
        isCloud = id == "list_allfavor" || /^subList_\d+/.test(id) || /^artist_\d+/.test(id) || /^album_\d+/.test(id),
        curSong = x.listCtrl.get("playlist").getCurSong(),
        switchHQ = _.bind(function() {
            var key = curSong ? curSong.getLinkKeyDesc(HQMode, isCloud) : "",
            link = key && curSong.links[key].songLink;
            if (!curSong || !key) {
                return
            }
            var getRealRate = function(key, rate) {
                if (rate == 320) {
                    return key.split("_")[1] || 320
                }
                return rate
            };
            if (link) {
                x.switchQ.totalTime = curSong.get("time") * 1e3;
                x.switchQ.switchByUrl(key !== curSong._curKey, link, {
                    defRate: getRealRate(curSong._curKey, curSong.get("rate")),
                    toRate: getRealRate(key, curSong.links[key]["rate"])
                })
            }
            if (key) {
                var mode = x.getModeByLinkKey(key);
                x.setCurHQType(mode);
                x._renderSel(curSong.links);
                if (mode !== HQMode) {
                    x.showHQNotMatchTip(HQMode)
                }
            }
        },
        x);
        var key = SongDataModel.createLinkKey(HQMode, isCloud);
        if (curSong.links && curSong.links[key] === undefined) {
            listCtrl.get("playlist").fetchLink({
                hq: 1,
                isCloud: isCloud,
                success: switchHQ
            })
        } else {
            switchHQ()
        }
    },x);
x.model.set("HQMode",HQMode);
realTimeSwitch();

使用方法:

           把蓝字的链接拖拽到您浏览器的书签栏(收藏夹)  在百度音乐盒页面点击该书签/收藏夹即可

           

     高品质音乐

上一篇:    下一篇:

me@ccc5.cc - 衫小寨