gpt4 book ai didi

ios - 播放透明背景IOS视频

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:14:08 26 4
gpt4 key购买 nike

<分区>

我想播放透明背景的视频。唯一不足的是,我在网上查到的资料都是“如何让视频背景透明”,但是我的视频背景已经是透明的,现在需要把播放器的背景做成透明。我怎么做?我试过这个:

NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"New Project 5" ofType:@"m4v"];
NSLog(@"%@",resourcePath);
NSURL *url = [NSURL fileURLWithPath:resourcePath];
NSLog(@"%@",url);

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

moviePlayer.shouldAutoplay=YES;
moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayer setFullscreen:NO animated:YES];
[self.view addSubview:moviePlayer.view];

moviePlayer.view.frame = CGRectMake(200, 600, 400, 300);

[moviePlayer play];

moviePlayer.view.backgroundColor = [UIColor clearColor];
for(UIView *aSubView in moviePlayer.view.subviews) {
aSubView.backgroundColor = [UIColor clearColor];
}

但它不起作用。它显示黑色背景。

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