is possible make video not close after has finished playing? allow user press "done" when video finished , video close.
viewcontroller.h
#import <uikit/uikit.h> #import <mediaplayer/mediaplayer.h> @interface player1: uiviewcontroller { } -(ibaction) playmovie; @end viewcontroller.m
#import "viewcontroller.h" @implementation player1 -(ibaction) playmovie { nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"2.dragtoopenfileinavm" oftype:@"mp4"]]; mpmovieplayerviewcontroller *windowsmac = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; [self presentmovieplayerviewcontrolleranimated:windowsmac]; windowsmac.movieplayer.moviesourcetype = mpmoviesourcetypefile; [windowsmac.movieplayer play]; windowsmac = nil; } this coding i'm using, help?
movieplayer = [[mpmovieplayerviewcontroller alloc]initwithcontenturl:[nsurl fileurlwithpath:path]]; [[nsnotificationcenter defaultcenter] removeobserver:movieplayer name:mpmovieplayerplaybackdidfinishnotification object:movieplayer.movieplayer]; [self presentviewcontroller:movieplayer animated:yes completion:nil];
Comments
Post a Comment