Starting Playback at Specific Position: Mobile SDK for iOS
The following code snippet illustrates the Objective C for the final step in XDR: to play the video at a specific initial position.
Note: The function getInitialTime shown here is a function you must write to retrieve the timestamp returned to your server. This value is then passed to the method playWithInitialTime.
. . . ooyalaPlayerViewController = [[OOOoyalaPlayerViewController alloc] initWithPcode:PCODE domain:PLAYERDOMAIN]; [ooyalaPlayerViewController.view setFrame:self.videoView.bounds]; [self addChildViewController:ooyalaPlayerViewController]; [self.videoView addSubview:ooyalaPlayerViewController.view]; int initialTime = [self getInitialTime]; [self.ooyalaPlayerViewController.player setEmbedCode:EMBED]; [self.ooyalaPlayerViewController.player playWithInitialTime:initialTime]; . . .
For more details about playWithInitialTime, see the documentation in the SDK package.