langyuxiansheng / vue-aliplayer-v2

这是一个基于Alipayer 开发并封装成vue组件的播放器.可播放rtmp,m3u8,mp4....视频.除支持直播流与点播的基础功能外,也支持视频的加密播放、清晰度切换、直播时移等业务场景等.https://help.aliyun.com/document_detail/125548.html?spm=a2c4g.11186623.3.3.4bafbf80OVkZJ9
https://langyuxiansheng.github.io/vue-aliplayer-v2/
MIT License
275 stars 59 forks source link

组件添加用不了, 只能用 vue.use 方式 #1

Closed cute-angelia closed 4 years ago

cute-angelia commented 4 years ago
import VueAliplayerV2 from "vue-aliplayer-v2";

  components: {
    "vue-aliplayer-v2": VueAliplayerV2
  },

image

rtmp 需要加

rtmpBufferTime:0,
showBuffer:0,

langyuxiansheng commented 4 years ago

感谢您的反馈,已经处理了局部引用的问题

<template>
    <div id="app">
        <vue-aliplayer-v2 
            @ready="handleReady" 
            ref="VueAliplayerV2" 
            id="player-1194076936807171180" 
            :options="options" />
    </div>
</template>
<script>
import VueAliplayerV2 from 'vue-aliplayer-v2';
export default {
    data(){
        return {
            options: {  //配置项  
                source:'rtmp://182.112.15.258:1688/hls/1194076936807171180'
            }
        }
    },
    components:{ VueAliplayerV2: VueAliplayerV2.Player }
}
</script>
langyuxiansheng commented 4 years ago

为了兼容官网的文档,组件源码中使用的属性和Alipayer官网的文档是一致的,没做任何的转换处理. 所以需要使用的属性,参考官网或者README上的都可. image