常见的H5直播格式及解析

m3u8

学习地址: http://www.cnblogs.com/afrog/p/6689179.html




    
    Title
    








flv

 



play(){
     var that=this;
     console.log(this.isPlay)
     if(!flvjs.isSupported()){
           that.paly=function () {
             Toast({
                 message: "您的设备不支持flv播放",
                 className: "toast",
                 position: 'bottom',
                 duration: 1000
             });
          }
           return that.paly()
       }
        this.isPlay=true;
        var video = document.getElementById('video');
        var flvPlayer = flvjs.createPlayer({
                 type: 'flv',
                 url:xxx.flv,  //视频源
         });
          flvPlayer.attachMediaElement(video);
          flvPlayer.load();
          flvPlayer.play();
          that.play=function () {
               if(that.isPlay){
                  video.pause()
                  that.isPlay=false;
                  return
                }
              video.play();
              that.isPlay=true
        }
 },

你可能感兴趣的:(常见的H5直播格式及解析)