Shannon Cole
Shannon Cole

Reputation: 362

LBYouTubeView: How to prevent auto-playing of videos

I'm setting up the LBTyouTubeView script at https://github.com/larcus94/LBYouTubeView and it automatically starts playing the YouTube. I've went through the files looking for the code to prevent it from automatically playing but am unable to locate anything.

Anyone know which line of code or area I should be looking to prevent the videos from automatically playing once loaded?

Or is this meant to be setup by putting the code in a method that I invoke myself by having a user press a play button or such UI item to cause the script to run and play the video?

Upvotes: 1

Views: 139

Answers (1)

Simon M
Simon M

Reputation: 2941

Look at the youTubeExtractor:didSuccessfullyExtractYouTubeURL: method on line 38 of LBYouTubePlayerController.m.

At the end of the method (line 44), [self play] is called.

To stop the framework from automatically playing videos, just comment out that line.

Upvotes: 2

Related Questions