Freeze streaming video after a few seconds

I tried to create a simple app that plays a live stream from a URL.

Everything works fine in the beginning than after a few seconds of video playback, but audio is still playing in the background.

var mediaPlayer: MPMoviePlayerController = MPMoviePlayerController()

var url = "http://keshethlslive-lh.akamaihd.net/i/c2n_1@195269/master.m3u8"

mediaPlayer.contentURL = NSURL(string: url)

mediaPlayer.view.frame = self.view.bounds
self.view.addSubview(mediaPlayer.view)

mediaPlayer.movieSourceType = MPMovieSourceType.Streaming

mediaPlayer.play()

      

+3


source to share





All Articles