Drew Baker
Drew Baker

Reputation: 14430

Stop video after exiting fullscreen on Mobile Safari

Hey Guys, I've got a thumbnail on a webpage that when clicked, plays a video in fullscreen using the webkitEnterFullscreen() method.

But I need the video to stop playing once the users touches the "Done" button and leaves fullscreen mode.

Is there an event that fires once the the user has exited fullscreen?

Thanks, Drew

Upvotes: 2

Views: 4402

Answers (1)

Drew Baker
Drew Baker

Reputation: 14430

I had an email from an Apple developer which answered this question for me.

The two events are webkitbeginfullscreen and webkitendfullscreen. This piece of sample code is really useful for seeing the order that events fire (it logs a message to the page whenever an event is emitted), and includes these two events:

http://developer.apple.com/library/safari/#samplecode/HTML5VideoEventFlow/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40010085-Intro-DontLinkElementID_2

Upvotes: 8

Related Questions