mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7616 from gin0606/fix_videoPlayer_ios_memory_leak
Fix iOS VideoPlayer memory leak.
This commit is contained in:
commit
007e42faa0
|
@ -132,11 +132,11 @@ using namespace cocos2d::experimental::ui;
|
|||
}
|
||||
|
||||
if (videoSource == 1) {
|
||||
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@(videoUrl.c_str())]];
|
||||
self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@(videoUrl.c_str())]] autorelease];
|
||||
self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
|
||||
} else {
|
||||
NSString *path = [UIVideoViewWrapperIos fullPathFromRelativePath:@(videoUrl.c_str())];
|
||||
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];
|
||||
self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]] autorelease];
|
||||
self.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
|
||||
}
|
||||
self.moviePlayer.allowsAirPlay = false;
|
||||
|
|
Loading…
Reference in New Issue