I have multiple images on 1 page, when click on particular image , video will open corresponding to that image on next page. Currently I have same id's for all image so I am not able to understand what to do to open that video on next page corresponding to image.
I am using below data:
[ [ 123, "thumb.jpg", "09-50-01.09-55-01.a-123-out.avi", ], [ 123, "thumb.jpg", "14-00-01.14-05-01.A-123-out.avi", ], [ 123, "thumb.jpg", "17-00-06.17-05-06.A-123-out.avi", ], [ 123, "thumb.jpg", "17-05-06.17-10-06.A-123-out.avi", ], [ 123, "thumb.jpg", "17-10-06.17-15-06.A-123-out.avi", ], [ 123, "thumb.jpg", "17-35-06.17-40-06.A-123-out.avi", ] ]
Please help. Thank you
What you can do if your video is on the next page, provide the ID in the route then the ID with a subscription.
constructor(
private route: ActivatedRoute,
) {}
setupSubscriptions() {
this.route.params.subscribe((params) => {
if (params.videoId) {
//Your logic to play the video here
}
});
)
Obviously you also need to pass unique id's and if this is not possible you can pass the video name in the route data.
And dont forget to call setupSubscriptions() in your ngOninit