vue 播放 rtmp

package.json

"vue-video-player": "^5.0.2",

main.js

// 播放視頻流
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
import "videojs-flash";
Vue.use(VideoPlayer)

vue頁面中 

<video-player class="vjs-custom-skin" :options="playerOptions" :playsinline="true"></video-player>
playerOptions: {
        height: "360",
        width: "500",
        sources: [
          {
            type: "rtmp/mp4",
            src: "rtmp://58.200.131.2:1935/livetv/hunantv"
          }
        ],
        techOrder: ["flash"],
        autoplay: true,
        controls: true
      },

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章