sean.zhou
2022-03-25 b944fff7414cd5d9b274ffcaf0b010ad9be965e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
  <div class="flex-column flex-justify-start flex-align-center">
    <a-button
      class="mt10  "
      style="width:90%"
      type="primary"
      @click="onAgoraLiveStream"
      >Agora Live</a-button
    >
    <a-button
      class="mt10"
      style="width:90%"
      type="primary"
      @click="onOthersLive"
      >RTMP/GB28181 Live</a-button
    >
  </div>
  <div v-if="enableAgoraLive">
    <a-modal
      style="top:0"
      v-model:visible="enableAgoraLive"
      title="Agora Live"
      width="100%"
      :maskClosable="false"
      wrapClassName="full-modal"
      :footer="null"
    >
      <LiveAgora />
    </a-modal>
  </div>
  <div v-if="enableOthersLive">
    <a-modal
      style="top:0"
      v-model:visible="enableOthersLive"
      title="RTMP/GB28181/RTSP Live"
      width="100%"
      :maskClosable="false"
      wrapClassName="full-modal"
      :footer="null"
    >
      <LiveOthers />
    </a-modal>
  </div>
</template>
 
<script lang="ts" setup>
import { ref } from 'vue'
import LiveAgora from './livestream-agora.vue'
import LiveOthers from './livestream-others.vue'
import { getRoot } from '/@/root'
const root = getRoot()
 
const enableAgoraLive = ref(false)
const enableOthersLive = ref(false)
const onAgoraLiveStream = () => {
  console.log('agora')
  enableAgoraLive.value = true
}
const onOthersLive = () => {
  console.log('liveview')
  enableOthersLive.value = true
}
</script>
 
<style lang="scss">
.full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
</style>