I'm currently developing a Single Page Application (SPA) using Vue 3, TypeScript, and The Movie Database (TMDB). Additionally, I'm incorporating Bootstrap 5 for the UI.
To showcase movie trailers on the movie details page, I've created the TrailerCarousel.vue
component:
<template>
// Component code here
</template>
<script lang="ts">
// Script code here
</script>
<style scoped lang="scss">
// Styling code here
</style>
I utilize this component in src\components\MovieDetails.vue
:
<div v-if="movieTrailers.length" class="mb-3">
// Movie Details code here
</div>
Stackblitz
For a demonstration, I've created a Stackblitz with the code.
Please note that the "www.youtube.com refused to connect" issue only occurs on Stackblitz for reasons unknown.
The Issue
While transitioning between trailers and playing them, the previously playing one does not stop, resulting in sound overlap. I'm struggling to find a solution to this problem.