I have a View inside the ViewController that I want to add a motion controller to it. But for now, I get only a black screen. I run this on a simulator and use the apple dev thread I tested in Safari and it works.
The video viewer is added to the controller via IBOutlet. I am using Xcode 6 beta 7.
This is all inside the UIViewController.
320x320 Video Image Ad (Global):
@IBOutlet var videoView: UIView!
MPMoviePlayerController declaration (global):
var videoPlayer : MPMoviePlayerController = MPMoviePlayerController()
Adding a video field for viewing:
videoURLWithPath = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8" let videoURL = NSURL(fileURLWithPath: videoURLWithPath) videoPlayer.movieSourceType = MPMovieSourceType.Streaming; videoPlayer.contentURL = videoURL videoPlayer.view.frame = videoView.bounds videoView.addSubview(videoPlayer.view) videoPlayer.controlStyle = MPMovieControlStyle.Embedded videoPlayer.prepareToPlay() videoPlayer.play()
Storyboard:

Simulator:

Update:
I also tried to do this. Super simple. And I still get the same result. The frame size is set so that I can see that the player has actually been added.
let streamURL = NSURL(string: "http://www.thumbafon.com/code_examples/video/segment_example/prog_index.m3u8") var streamPlayer = MPMoviePlayerController(contentURL: streamURL) streamPlayer.view.frame = CGRect(x: 10, y: 10, width: 200, height: 200) streamPlayer.controlStyle = MPMovieControlStyle.Embedded videoView.addSubview(streamPlayer.view) streamPlayer.play()
bzmw source share