Advertisement
Guest User

Untitled

a guest
Nov 14th, 2017
56
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.    
  4.     if(stream.url){
  5.     NSURL *videoURL = [[NSURL alloc] initWithString:stream.url];
  6.    
  7.     VideoStreamObject *videoStreamObject = [[VideoStreamObject alloc] initWithStreamURL:videoURL.absoluteString];
  8.    
  9.     [videoStreamObject prepareStream:^(BOOL success, NSURL *url) {
  10.         dispatch_async(dispatch_get_main_queue(), ^{
  11.             [_moviePlayerViewController.moviePlayer stop];
  12.             _moviePlayerViewController.moviePlayer.contentURL = url;
  13.             _moviePlayerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
  14.             [_moviePlayerViewController.moviePlayer prepareToPlay];
  15.             [_moviePlayerViewController.moviePlayer play];
  16.          });
  17.     }];}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement