gpt4 book ai didi

ios - 视频播放 url 黑屏来自服务器端

转载 作者:行者123 更新时间:2023-11-29 12:47:40 24 4
gpt4 key购买 nike

  1. NSArray *路径 =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,是); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *pathVideo = [documentsDirectory stringByAppendingPathComponent:@"MyVideo.mp4"];
    NSURL *movieURL = [NSURL fileURLWithPath:pathVideo]; self.movi​​ePlayer = [[MPMoviePlayerController 分配] 初始化]; [self.movi​​ePlayer setShouldAutoplay:YES]; [self.movi​​ePlayer setContentURL:movieURL.absoluteURL]; [self.movi​​ePlayer setMovieSourceType:MPMovieSourceTypeFile]; [self.movi​​ePlayer setControlStyle:MPMovieControlModeDefault]; [self.movi​​ePlayer setFullscreen:NO]; [self.movi​​ePlayer setScalingMode:MPMovieScalingModeNone]; self.movi​​ePlayer.view.frame = CGRectMake(40, 40, 240, 350); [self.view addSubview:self.movi​​ePlayer.view]; [self.movi​​ePlayer prepareToPlay]; [self.movi​​ePlayer播放];

最佳答案

[self.view addSubview:self.moviePlayer.view]; add this before

[self.moviePlayer prepareToPlay];
[self.moviePlayer play];

这些行。

仅供引用。并且这个播放器可以在模拟器中播放。

关于ios - 视频播放 url 黑屏来自服务器端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23235717/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com