diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index d0a8dd819a..16b40d89c9 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -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;