gpt4 book ai didi

iOS 媒体播放器 求

转载 作者:可可西里 更新时间:2023-11-01 05:00:23 29 4
gpt4 key购买 nike

我可以使用 iOS MediaPlayer 并通过这种方式播放电影。但我需要,寻找一秒钟的电影。我该怎么做,我像这样通过 MediaPlayer 播放电影:

    NSURL *videoURL = [NSURL fileURLWithPath:self.filename];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

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

提前致谢..

最佳答案

抱歉自己的回答,

NSURL *videoURL = [NSURL fileURLWithPath:self.filename];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

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

这对我有用,以便在电影中寻找时间......

关于iOS 媒体播放器 求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6295188/

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