Answer the question
In order to leave comments, you need to log in
How to stop downloading and playing video in SPA app when navigating to another page?
There is an application created using SPA technology using Framework7 + Vue. There is a video on one page. It is necessary that the video download and playback stop when you go to another page.
Poke where to read about it, or give advice in which direction to look.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Something like this?
router.beforeEach((to, from, next) => {
if (from.matched.some(record => record.meta.hasMultimedia)) {
stopAllPlayings();
next();
} else next();
});
const routes = [
{
path: '/funnyCatsVideos',
component: require('./views/funny-cats-videos.vue'),
name: 'videos',
meta: { hasMultimedia: true }
},
Depends on how the app is navigated. If vuerouter is used, then you can try using hooks: https://router.vuejs.org/en/advanced/navigation-gu...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question