<template>
    <div class="home">
        <!-- <img alt="Vue logo" src="../assets/logo.png">
        <HelloWorld msg="Welcome to Your Vue.js App"/> -->
        <VideoPlayerComponent :videoUrl="videoUrl" :videoType="videoType" />
    </div>
</template>

<script>
    // @ is an alias to /src
    // import HelloWorld from '@/components/HelloWorld.vue'
    import VideoPlayerComponent from '@/components/VideoPlayerComponent.vue';
    import requestConfig from '@/utils/requestConfig';
    export default {
        name: 'HomeView',
        components: {
            // HelloWorld,
            VideoPlayerComponent
        },
        data() {
            return {
                // https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
                // videoUrl: 'https://gcalic.v.myalicdn.com/gc/zyqcdx01_1/index.m3u8', // HLS 流地址
                // videoType: 'hls', // 或 'flv'
                // 快手直播里面的
                // videoUrl: 'https://ws-origin.pull.yximgs.com/gifshow/kwai_actL_ksle_20250411142108_GwU_strL_hd2000.flv?wsTime=67fa1bac&wsSecret=c09f848b129c9e352a4eab5ce2e06a80&stat=HKoB%2BwNN2oCYt7Rc2VlNANkgzdjg%2BiPBuC2zPQcpCqA6tJusJ0cQ%2BhKEfVoBjqV7&tsc=origin&oidc=watchmen&sidc=2062&no_script=1&srcStrm=lytuRPfcqgM&fd=0&ss=s20&tfc_buyer=0&kabr_spts=-5000', // HLS 流地址
                // videoType: 'flv', // 或 'flv'
                videoUrl: 'rtmp://36.150.174.132:57935/oss/eHh4eFNfMjQ0ODQ1YmU5MTNkOjg1NTc5NTI2NDAwODI0ODUyODc?deviceId=xxxxS_244845be913d&expireTime=1744858930&playType=0', // HLS 流地址
                videoType: 'rtmp', // 或 'flv'
            };
        },
        mounted() {
            this.getIpAddr()
        },
        methods: {
            // 获取客户端小程序IP地址
            async getIpAddr() {
                const res = await requestConfig('getIpAddr', {}, true);
                if (res.data && res.data.success && res.data.single) {
                    // this.globalData.ip = res.single;
                    console.log("***app.js-onLaunch-getIpAddr***", res.data.single)
                }
            },
        },
    }
</script>