Can I stop the video player when i navigate away from that page

I am working on a simple app that will play a downloaded video when I navigate from a home page to a new page. Think about being in a museum and pressing a button on an ipad. I want to go to a new page and play a video. I would like to beable to return to the home page by pressing a button.

My problem is that when I navigate back to the home screen the video will not stop playing.

I have been unable to find any tutorials about using blocks to trigger the video player to play when using a downloaded video. Here are screen shots of my pages. I would appreciate any help you can offer.

I am not getting any feedback for my question. Is this because I am missing some basic programing knowledge and should refer to documentation?

You just posted your issue a few hours ago. We are here all users like you. When anyone of the users who faced a similar issue reads your post, will respond to you.

Until then, it is better to provide more info such as the event you have in your codes to start the video because I don’t see any blocks related to video in the images you shared.

Happy Thunking!

2 Likes

Thanks Muneer,

Right now I am looking for some guidance in setting up a code block to start the video when I open the page. Right now the video starts when the page open with no code blocks necessary, however, then no code thread to stop it. I will continue to work on it and post any progress I make.

Thanks so much for your reply. I am feeling a bit lost at the moment. I appreciate your support.

1 Like

I just made a quick project with two screens and a video and a button in the first screen and just a button in the second screen to go back to the first screen.

These are the codes for Screen1

image

And this is Screen2
image

It works as expected.

Thanks so much let me give that a shot real quick.

1 Like

how do you get (set video1 block) on the first page when the the video is not on page one?

1 Like

It’s the first one in the list

image

here are my options on page one and two

Here is page one

here is page two

I get the video on page two because I have added that component to page two.

1 Like

So when you click on Video1 that is in page 2 (video) screen you will see the Set Video1 s Video block.

You need to add this block to the Screen Opens event.

Thanks so much for your help Muneer. This is leading me to the right direction. I will post solved as soon as I can work out the bugs. Thanks so much for your time and effort.

1 Like

Well I tried this code, but the audio from the video continues after navigating back to screen 1?

1 Like

Thanks again muneer! You got me there!

1 Like

Yes, this is correct.
The block to assign a video file to the video player is in the Screen Opens event. So every time you navigate back to the screen it will start playing.

If this is not the wanted behavior then you can adjust the blocks to reflect what you want.