Reputation: 261
I am using the below code to play the video, but its working fine while using the local url that mean resourse file path. Not working for server url.
player = [[MPMoviePlayerViewController alloc] initWithContentURL:urlvalue];
player.view.frame = CGRectMake(10, 10, 800, 800);
player.moviePlayer.shouldAutoplay=YES;
player.moviePlayer.movieSourceType= MPMovieSourceTypeFile;
[player.moviePlayer setControlStyle:MPMovieControlStyleDefault];
[self.view addSubview:player.view];
[player.moviePlayer prepareToPlay];
[player.moviePlayer play];
Kindly correct me if I missed out something. Thanks in advance.
Upvotes: 0
Views: 317
Reputation: 219
Pay attention on iOS 9 App transport security. If you haven't set it up, streaming will fail with black empty screen.
Upvotes: 1
Reputation: 38239
Change movieSourceType
from File
to Streaming
:
player.moviePlayer.movieSourceType= MPMovieSourceTypeStreaming;
Note : url
should be a streaming url
not physical file path
Upvotes: 0