Advertisement
Guest User

Untitled

a guest
Nov 14th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)playStationStream {
  2.     EGStream *stream = _station.streams[0];
  3.     NSURL *videoURL = [[NSURL alloc] initWithString:stream.url];
  4.    
  5.     VideoStreamObject *videoStreamObject = [[VideoStreamObject alloc] initWithStreamURL:videoURL.absoluteString];
  6.    
  7.     if(!(videoStreamObject == nil)){
  8.     [videoStreamObject prepareStream:^(BOOL success, NSURL *url) {
  9.         dispatch_async(dispatch_get_main_queue(), ^{
  10.             [_moviePlayerViewController.moviePlayer stop];
  11.             _moviePlayerViewController.moviePlayer.contentURL = url;
  12.             _moviePlayerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
  13.             [_moviePlayerViewController.moviePlayer prepareToPlay];
  14.             [_moviePlayerViewController.moviePlayer play];
  15.          });
  16.     }];}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement