{"version":3,"file":"PlayerVideo-B351lPDY.mjs","names":[],"sources":["../src/components/misc/player/video/PlayerVideo.vue","../src/components/misc/player/video/PlayerVideo.vue"],"sourcesContent":["<template>\n  <teleport to=\".octopus-app\">\n    <template v-if=\"playerStore.playerVideo\">\n      <button class=\"btn btn-transparent video-close\" @click=\"closePlayer\">\n        <WindowCloseIcon />\n      </button>\n      <div class=\"video-wrapper\">\n        <PlayerYoutubeEmbed v-if=\"youtubeId\" :youtube-id=\"youtubeId\" />\n        <PlayerVideoDigiteka\n          v-else-if=\"!playerStore.playerLive\"\n          :video-id=\"playerStore.playerPodcast?.video?.videoId\"\n          :podcast-id=\"playerStore.playerPodcast.podcastId\"\n        />\n        <PlayerVideoHls v-else :hls-url=\"hlsVideoUrl\" :is-secured=\"isSecured\"/>\n      </div>\n    </template>\n  </teleport>\n</template>\n<script setup lang=\"ts\">\nimport youtubeVideoHelper from \"../../../../helper/youtubeVideoHelper\";\nimport WindowCloseIcon from \"vue-material-design-icons/WindowClose.vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useApiStore } from \"../../../../stores/ApiStore\";\nimport { defineAsyncComponent, ref, Ref, computed, onMounted } from \"vue\";\nconst PlayerVideoDigiteka = defineAsyncComponent(\n  () => import(\"../video/PlayerVideoDigiteka.vue\"),\n);\nconst PlayerVideoHls = defineAsyncComponent(\n  () => import(\"../video/PlayerVideoHls.vue\"),\n);\nconst PlayerYoutubeEmbed = defineAsyncComponent(\n  () => import(\"../video/PlayerYoutubeEmbed.vue\"),\n);\n\n//Data \nconst youtubeId: Ref<string|undefined> = ref(undefined);\n\n//Composables\nconst apiStore = useApiStore();\nconst playerStore = usePlayerStore();\n\n\n//Computed\nconst isSecured = computed(() => \"SECURED\" === playerStore.playerLive?.organisation?.privacy);\nconst hlsVideoUrl = computed(() => {\n  if (!playerStore.playerHlsIdentifier) {\n    return \"\";\n  }\n  return `${apiStore.hlsUrl}live/video_${playerStore.playerHlsIdentifier}/index.m3u8`;\n});\n\nonMounted(()=>{\n  youtubeId.value = youtubeVideoHelper.getYoutubeId((playerStore.playerPodcast ?? playerStore.playerLive )?.tags ?? []);\n})\n\n//Methods\nfunction closePlayer() {\n  playerStore.playerPlay();\n}\n</script>\n\n<style lang=\"scss\">\n.octopus-app {\n  .video-wrapper {\n    border-radius: 1rem;\n    overflow: hidden;\n    position: fixed;\n    bottom: 2.5rem;\n    right: 0;\n    z-index: 10;\n  }\n\n  .video-close {\n    position: fixed;\n    bottom: 16.5rem;\n    right: 1rem;\n  }\n\n  @media (width <= 500px) {\n    .video-close {\n      bottom: 10.5rem;\n    }\n\n    .video-wrapper iframe {\n      width: 100%;\n      max-height: 150px;\n    }\n  }\n}\n</style>\n","<template>\n  <teleport to=\".octopus-app\">\n    <template v-if=\"playerStore.playerVideo\">\n      <button class=\"btn btn-transparent video-close\" @click=\"closePlayer\">\n        <WindowCloseIcon />\n      </button>\n      <div class=\"video-wrapper\">\n        <PlayerYoutubeEmbed v-if=\"youtubeId\" :youtube-id=\"youtubeId\" />\n        <PlayerVideoDigiteka\n          v-else-if=\"!playerStore.playerLive\"\n          :video-id=\"playerStore.playerPodcast?.video?.videoId\"\n          :podcast-id=\"playerStore.playerPodcast.podcastId\"\n        />\n        <PlayerVideoHls v-else :hls-url=\"hlsVideoUrl\" :is-secured=\"isSecured\"/>\n      </div>\n    </template>\n  </teleport>\n</template>\n<script setup lang=\"ts\">\nimport youtubeVideoHelper from \"../../../../helper/youtubeVideoHelper\";\nimport WindowCloseIcon from \"vue-material-design-icons/WindowClose.vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useApiStore } from \"../../../../stores/ApiStore\";\nimport { defineAsyncComponent, ref, Ref, computed, onMounted } from \"vue\";\nconst PlayerVideoDigiteka = defineAsyncComponent(\n  () => import(\"../video/PlayerVideoDigiteka.vue\"),\n);\nconst PlayerVideoHls = defineAsyncComponent(\n  () => import(\"../video/PlayerVideoHls.vue\"),\n);\nconst PlayerYoutubeEmbed = defineAsyncComponent(\n  () => import(\"../video/PlayerYoutubeEmbed.vue\"),\n);\n\n//Data \nconst youtubeId: Ref<string|undefined> = ref(undefined);\n\n//Composables\nconst apiStore = useApiStore();\nconst playerStore = usePlayerStore();\n\n\n//Computed\nconst isSecured = computed(() => \"SECURED\" === playerStore.playerLive?.organisation?.privacy);\nconst hlsVideoUrl = computed(() => {\n  if (!playerStore.playerHlsIdentifier) {\n    return \"\";\n  }\n  return `${apiStore.hlsUrl}live/video_${playerStore.playerHlsIdentifier}/index.m3u8`;\n});\n\nonMounted(()=>{\n  youtubeId.value = youtubeVideoHelper.getYoutubeId((playerStore.playerPodcast ?? playerStore.playerLive )?.tags ?? []);\n})\n\n//Methods\nfunction closePlayer() {\n  playerStore.playerPlay();\n}\n</script>\n\n<style lang=\"scss\">\n.octopus-app {\n  .video-wrapper {\n    border-radius: 1rem;\n    overflow: hidden;\n    position: fixed;\n    bottom: 2.5rem;\n    right: 0;\n    z-index: 10;\n  }\n\n  .video-close {\n    position: fixed;\n    bottom: 16.5rem;\n    right: 1rem;\n  }\n\n  @media (width <= 500px) {\n    .video-close {\n      bottom: 10.5rem;\n    }\n\n    .video-wrapper iframe {\n      width: 100%;\n      max-height: 150px;\n    }\n  }\n}\n</style>\n"],"mappings":";;;;;;;;;;;EAwBA,MAAM,sBAAsB,2BACpB,OAAO,qCACf;EACA,MAAM,iBAAiB,2BACf,OAAO,gCACf;EACA,MAAM,qBAAqB,2BACnB,OAAO,oCACf;EAGA,MAAM,YAAmC,IAAI,KAAA,CAAS;EAGtD,MAAM,WAAW,YAAY;EAC7B,MAAM,cAAc,eAAe;EAInC,MAAM,YAAY,eAAe,cAAc,YAAY,YAAY,cAAc,OAAO;EAC5F,MAAM,cAAc,eAAe;GACjC,IAAI,CAAC,YAAY,qBACf,OAAO;GAET,OAAO,GAAG,SAAS,OAAO,aAAa,YAAY,oBAAoB;EACzE,CAAC;EAED,gBAAc;GACZ,UAAU,QAAQ,2BAAmB,cAAc,YAAY,iBAAiB,YAAY,aAAc,QAAQ,CAAC,CAAC;EACtH,CAAC;EAGD,SAAS,cAAc;GACrB,YAAY,WAAW;EACzB;;;;;;;;;;;;;;;;;;;;;;mBCpDW,OAAM,gBAAe;;qBAL9B,YAeW,UAAA,EAfD,IAAG,eAAc,GAAA,CACT,OAAA,YAAY,eAAA,UAAA,GAA5B,mBAaW,UAAA,EAAA,KAAA,EAAA,GAAA,CAZT,mBAES,UAAA;EAFD,OAAM;EAAmC,SAAO,OAAA;KACtD,YAAmB,OAAA,kBAAA,CAAA,CAAA,GAErB,mBAQM,OARN,YAQM,CAPsB,OAAA,aAAA,UAAA,GAA1B,YAA+D,OAAA,uBAAA;;EAAzB,cAAY,OAAA;iCAEpC,OAAA,YAAY,cAAA,UAAA,GAD1B,YAIE,OAAA,wBAAA;;EAFC,YAAU,OAAA,YAAY,eAAe,OAAO;EAC5C,cAAY,OAAA,YAAY,cAAc;0DAEzC,YAAuE,OAAA,mBAAA;;EAA/C,WAAS,OAAA;EAAc,cAAY,OAAA"}