|
@@ -13,15 +13,19 @@ import { useUserAuthStore } from "@/stores/userAuth";
|
|
|
|
|
|
import Modal from "@/components/Modal.vue";
|
|
import Modal from "@/components/Modal.vue";
|
|
import { YoutubeVideo } from "@/components/YoutubeVideoInfo.vue";
|
|
import { YoutubeVideo } from "@/components/YoutubeVideoInfo.vue";
|
|
|
|
+import { SoundcloudTrack } from "@/components/SoundcloudTrackInfo.vue";
|
|
|
|
|
|
const YoutubeVideoInfo = defineAsyncComponent(
|
|
const YoutubeVideoInfo = defineAsyncComponent(
|
|
() => import("@/components/YoutubeVideoInfo.vue")
|
|
() => import("@/components/YoutubeVideoInfo.vue")
|
|
);
|
|
);
|
|
-
|
|
|
|
const YoutubePlayer = defineAsyncComponent(
|
|
const YoutubePlayer = defineAsyncComponent(
|
|
() => import("@/components/YoutubePlayer.vue")
|
|
() => import("@/components/YoutubePlayer.vue")
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+const SoundcloudTrackInfo = defineAsyncComponent(
|
|
|
|
+ () => import("@/components/SoundcloudTrackInfo.vue")
|
|
|
|
+);
|
|
|
|
+
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
modalUuid: { type: String, required: true },
|
|
modalUuid: { type: String, required: true },
|
|
mediaSource: { type: String, default: null }
|
|
mediaSource: { type: String, default: null }
|
|
@@ -35,6 +39,18 @@ const youtubeVideo = ref<YoutubeVideo>({
|
|
duration: 0
|
|
duration: 0
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const soundcloudTrack = ref<SoundcloudTrack>({
|
|
|
|
+ _id: null,
|
|
|
|
+ trackId: null,
|
|
|
|
+ userPermalink: null,
|
|
|
|
+ permalink: null,
|
|
|
|
+ title: null,
|
|
|
|
+ username: null,
|
|
|
|
+ duration: 0,
|
|
|
|
+ soundcloudCreatedAt: null,
|
|
|
|
+ artworkUrl: null
|
|
|
|
+});
|
|
|
|
+
|
|
const currentSongMediaType = computed(() => props.mediaSource.split(":")[0]);
|
|
const currentSongMediaType = computed(() => props.mediaSource.split(":")[0]);
|
|
const currentSongMediaValue = computed(() => props.mediaSource.split(":")[1]);
|
|
const currentSongMediaValue = computed(() => props.mediaSource.split(":")[1]);
|
|
|
|
|
|
@@ -109,6 +125,26 @@ onMounted(() => {
|
|
},
|
|
},
|
|
{ modalUuid: props.modalUuid }
|
|
{ modalUuid: props.modalUuid }
|
|
);
|
|
);
|
|
|
|
+ } else if (currentSongMediaType.value === "soundcloud") {
|
|
|
|
+ socket.dispatch(
|
|
|
|
+ "soundcloud.getTrack",
|
|
|
|
+ currentSongMediaValue.value,
|
|
|
|
+ true,
|
|
|
|
+ res => {
|
|
|
|
+ if (res.status === "success") {
|
|
|
|
+ soundcloudTrack.value = res.data;
|
|
|
|
+ loaded.value = true;
|
|
|
|
+
|
|
|
|
+ socket.dispatch(
|
|
|
|
+ "apis.joinRoom",
|
|
|
|
+ `view-media.${props.mediaSource}`
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ new Toast("SoundCloud track with that ID not found");
|
|
|
|
+ closeCurrentModal();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -132,6 +168,10 @@ onBeforeUnmount(() => {
|
|
<youtube-video-info :video="youtubeVideo" />
|
|
<youtube-video-info :video="youtubeVideo" />
|
|
<youtube-player :song="youtubeSongNormalized" />
|
|
<youtube-player :song="youtubeSongNormalized" />
|
|
</template>
|
|
</template>
|
|
|
|
+ <template v-else-if="currentSongMediaType === 'soundcloud'">
|
|
|
|
+ <soundcloud-track-info :track="soundcloudTrack" />
|
|
|
|
+ <!-- <youtube-player :song="youtubeSongNormalized" /> -->
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
<div v-else class="vertical-padding">
|
|
<div v-else class="vertical-padding">
|
|
<p>Media hasn't loaded yet</p>
|
|
<p>Media hasn't loaded yet</p>
|