<view class="item" style="text-align: center;">
            <image bindtap="txvideoPlay" data-txv="{{item.tvideo2}}" class="play-btn" src="{{stop?'../../resource/images/book_opt_1a.png':'../../resource/images/dictation_button_pause.png'}}"></image>
            <view class="text">视频微课</view>
        </view>

txvideoPlay:function(e){
    console.log(e);
    var vedio=e.currentTarget.dataset.txv;
    var videoUrl='';
    if (!vedio) return
    var vid = vedio.substring(vedio.lastIndexOf('/') + 1, vedio.lastIndexOf('html') - 1);
    var that = this;
    var urlString = 'https://vv.video.qq.com/getinfo?otype=json&appver=3.2.19.333&platform=11&defnpayver=1&vid=' + vid;
    wx.request({
      url: urlString,
      success: function (res) {
        console.log(res);
        var dataJson = res.data.replace(/QZOutputJson=/, '') + "qwe";
        var dataJson = dataJson.replace(';qwe', '');
       // dataJson = dataJson.replace(';', '');
        
       var data = JSON.parse(dataJson);
       console.log(dataJson);
       //var data =dataJson
        var fileName = data['vl']['vi'][0]['fn'];
        var fvkey = data['vl']['vi'][0]['fvkey'];
        var host = data['vl']['vi'][0]['ul']['ui'][2]['url']
        console.log(host);
        console.log(fileName);
        console.log(fvkey);
          videoUrl= host + fileName + '?vkey=' + fvkey;
          console.log(videoUrl);
          that.setData({videoarea:!0});
          //  this.setData({shadow:"block"});
          //  this.setData({exit:"block"});
          console.log(videoUrl);
          that.setData({videosrc:videoUrl});
      }
    })
    
  

  },
wxml:
<view class="item" style="text-align: center;">
            <image bindtap="txvideoPlay" data-txv="{{item.tvideo2}}" class="play-btn" src="{{stop?'../../resource/images/book_opt_1a.png':'../../resource/images/dictation_button_pause.png'}}"></image>
            <view class="text">视频微课</view>
        </view>
上面链接改一下,部分腾讯视频获取不了:
 var urlString = 'https://vv.video.qq.com/getinfo?platform=101001&charge=0&otype=json&vid=' + vid;

https://www.sznest.net/jzjs/3516.html https://www.sznest.net/html/get_the_real_address_of_Tencent_video.php

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
返回
顶部