Skip to content

Instantly share code, notes, and snippets.

View intmainvoid's full-sized avatar

Gavin Conway intmainvoid

  • Sydney, Australia
View GitHub Profile
@intmainvoid
intmainvoid / MPMoviePlayerViewController_example.swift
Last active June 13, 2016 15:57
Implement MPMoviePlayerController in just a few lines of code
let movieController: MPMoviePlayerViewController = MPMoviePlayerViewController(contentURL: NSURL(http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8))
presentMoviePlayerViewControllerAnimated(movieController)
movieController.moviePlayer.play()
func invisibleButtonTapped(sender: UIButton!)
{
var playerIsPlaying:Bool = self.avPlayer.rate > 0
if (playerIsPlaying) {
self.avPlayer.pause();
} else {
self.avPlayer.play();
}
}