我搜索了所有類似的問題,但無奈。 這是關於使用MPMoviePlayerController的流式傳輸https://172.16.58.100:8443/test02.mp4
URL。MPMoviePlayerController:流https URL失敗
我使用MPMoviePlayerController來流式傳輸視頻並在我的應用程序中播放。 像http://172.16.58.100:8080/test.mp4
這樣的網址是好的,MPMoviePlayerController工作正常。
但是像URL,MPMoviePlayerController不起作用,它返回MPMovieFinishReasonPlaybackError
。我知道這意味着videoPlayer初始化失敗並導致MPMoviePlayerPlaybackDidFinishNotification
。我不知道如何做到這一點。
我也試過這樣:
NSURLCredential *credental = [[NSURLCredential alloc]initWithUser:@"tomcat"
password:@"123456"
persistence:NSURLCredentialPersistenceForSession];
NSURLProtectionSpace *protectSpace = [[NSURLProtectionSpace alloc]initWithHost:@"172.16.58.100"
port:8443
protocol:@"http"
realm:nil
authenticationMethod:NSURLAuthenticationMethodDefault];
[[NSURLCredentialStorage sharedCredentialStorage]setDefaultCredential:credental forProtectionSpace:protectSpace];
NSURL *fileURL = [NSURL URLWithString:@"https://172.16.58.100:8443/test.mp4"];
[self.moviePlayer playMovieFile:fileURL];
但它仍然顯示了同樣的錯誤(初始化失敗,進入MPMoviePlayerPlaybackDidFinishNotification)
============== ===============
我的意思是我只是想知道如何通過MPMoviePlayerController流像「https://xxx.xxx.xx.mp4」的URL。
有什麼建議嗎?聖誕節快樂。