gpt4 book ai didi

objective-c - 如何显示 MPMoviePlayerController 控件?

转载 作者:可可西里 更新时间:2023-11-01 17:10:03 25 4
gpt4 key购买 nike

我有 MPMoviePlayerController,我想以编程方式显示控件,例如在用户点击后,或模拟用户点击。

http://i.stack.imgur.com/KYMmG.jpg (Sorry, I don't have enough reputation, to post images).

我该怎么做?谢谢。

最佳答案

以下列方式创建 MPMoviePlayerController 对象将为您提供视频控件的界面

yourMoviePlayerController = [MPMoviePlayerController new];     
yourMoviePlayerController.controlStyle=MPMovieControlStyleEmbedded;
[yourMoviePlayerController setContentURL:[NSURL fileURLWithPath:videoPath]];
yourMoviePlayerController.backgroundView.hidden = YES;

[yourMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
yourMoviePlayerController.shouldAutoplay=YES;
yourMoviePlayerController.movieSourceType = MPMovieSourceTypeFile;

关于objective-c - 如何显示 MPMoviePlayerController 控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12087086/

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