<!-- 首页 -->
<template>
    <div class="home">
      <miniProgramPlayback v-if="pageType == 'miniProgramPlayback'"></miniProgramPlayback>
      <miniProgramVideo v-if="pageType == 'miniProgramVideo'"></miniProgramVideo>
      <miniProgramVideoMpegts v-if="pageType == 'miniProgramVideoMpegts'"></miniProgramVideoMpegts>
      <miniProgramVideoHls v-if="pageType == 'miniProgramVideoHls'"></miniProgramVideoHls>
    </div>
</template>
<script>
    import miniProgramPlayback from '@/views/miniProgramPlayback/index.vue';
    import miniProgramVideo from '@/views/miniProgramVideo/index.vue';
    import miniProgramVideoMpegts from '@/views/miniProgramVideoMpegts/index.vue';
    import miniProgramVideoHls from '@/views/miniProgramVideoHls/index.vue';
    export default {
        name: 'home',
        components: {
          miniProgramPlayback,
          miniProgramVideo,
          miniProgramVideoMpegts,
          miniProgramVideoHls,
        },
        data() {
            return {
              pageType:null,
              appName:null,
            }
        },
        created() {

        },
        mounted() {
          let text = decodeURIComponent(window.location.href);
          text = text.split("?")[1]
          if(text.indexOf('touken') != -1){
            // this.$router.push({
            //   path: '/miniProgramVideo'+'?'+text,
            // });
            if(text.indexOf('mpegts') != -1){
              this.$set(this,'pageType','miniProgramVideoMpegts');
            }else if(text.indexOf('hls') != -1){
              this.$set(this,'pageType','miniProgramVideoHls');
            }else{
              this.$set(this,'pageType','miniProgramVideo');
            }
          }else if(text.indexOf('cameraIndexCode') != -1){
            // this.$router.push({
            //   path: '/miniProgramPlayback'+'?'+text,
            // });
            this.$set(this,'pageType','miniProgramPlayback');
          }
        },
        methods: {},
    }
</script>
<style scoped lang="scss">
    .home{
      flex:1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
</style>
