<template>
  <div>
    <Player @close="$emit('close')" :url="src.url" :brand="src.brand" :name="name" label="舱外" />
  </div>
</template>

<script>
import Player from "../components/player";
import { mapState } from "vuex";

export default {
  name: "OuterPlayer",
  components: { Player },
  data() {
    return {};
  },
  computed: {
    ...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
    name() {
      return `${this.hangar?.uav?.organizationName || ""}机库无人机`;
    },
    src() {
      return (
        this.hangar?.uav?.streamConfiguration
          ?.find((v) => v.videoType === 3)
          ?.streamUrlMessage.map((v) => ({
            label: v.streamType.toLocaleLowerCase(),
            url: v.streamUrl,
            brand: v.streamType,
          }))[0] || {
          url: "",
          brand: "",
        }
      );
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
</style>