<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: "InnerPlayer",
  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 === 2)
          ?.streamUrlMessage.map((v) => ({
            label: v.streamType.toLocaleLowerCase(),
            url: v.streamUrl,
            brand: v.streamType,
          }))[0] || {
          url: "",
          brand: "",
        }
      );
    },
  },
};
</script>

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