开发者

How to reset the content URL for MPMoviePlayerController when playing a video?

开发者 https://www.devze.com 2023-03-31 18:37 出处:网络
I want to reset the content URL for the MPMoviePlayerController object when playing a video. on a button click, I am setting the content URL like below,开发者_如何学编程

I want to reset the content URL for the MPMoviePlayerController object when playing a video.

on a button click, I am setting the content URL like below,开发者_如何学编程

[videoPlayer setContentURL:url];

But i am getting the "Bad Access" error.

Is there a way to change the url when a movie player is already playing a video? It should stop the previous video and should start the video for the new url.


It means you didn't allocate memory to videoplayer

MPMoviePlayerController * videoplayer = [MPMoviePlayerController alloc] init];
[videoplayer setcontenturl: url];

it will not give you any error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号