<template>
    <div class="videoplay">
        <div class="dialogVideo" id="video">

        </div>
    </div>
</template>

<script>
    export default {
        name: "",
        data() {
            return {}
        },
        created() {
        },
        mounted(){
            this.videoUrl = this.$route.query.url;
          this.loading();
        },
        methods: {
            loading(){
                // this.videoUrl = 'rtmp://58.200.131.2:1935/livetv/dftv';
                var that = this
                setTimeout(function () {
                    var videoObject = {
                        container: "#video", //“#”代表容器的ID，“.”或“”代表容器的class
                        variable: "player", //该属性必需设置，值等于下面的new chplayer()的对象
                        autoplay: true, //自动播放
                        live: true,
                        // loaded: 'loadHandler',
                        rotation: 90,
                        html5m3u8: true, //是否使用hls，默认不选择，如果此属性设置成true，则不能设置flashplayer:true,
                        video: that.videoUrl //视频地址(必填)
                    }
                    // 定义一个对象
                    var player = new ckplayer(videoObject);
                    console.log(player)
                }, 1000)
            }
        }

    }
</script>

<style scoped lang="scss" type="text/scss">
.videoplay{
    width: 100%;
    height: 100%;
}
</style>