MPMoviePlayerViewController Black Screen Issue


hi all,

working on creating current app developed iphone work universal app.

playing videos, per instructions given in iphone sdk 3.2, first creating mpmovieplayerviewcontroller's object , passing url of video file object. in same method, writing notification "mpmovieplayerplaybackdidfinishnotification".

when first play video, video visible, when click on done button or when video finishes automatically, video controller view disappears (this require). when again open video, audio coming, not showing video.

here code writing playing video:


mpmovieplayerviewcontroller *playerviewcontroller_ipad = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url];
[self presentmovieplayerviewcontrolleranimated: playerviewcontroller_ipad];
[playerviewcontroller_ipad release];
playerviewcontroller_ipad.movieplayer.initialplaybacktime = 0;


[[nsnotificationcenter defaultcenter] addobserver:self selector:mad:selector(movieplaybackdidfinished:)
name:mpmovieplayerplaybackdidfinishnotification
object:playerviewcontroller_ipad.movieplayer];


, in notification method:

mpmovieplayercontroller *player1 = [_notification object];
[[nsnotificationcenter defaultcenter] removeobserver:self name:mpmovieplayerplaybackdidfinishnotification object:player1];
[player1 stop];
player1.initialplaybacktime = -1;
[self dismissmovieplayerviewcontrolleranimated];


please review code , if has clue on it, please post it. need urgently.

in advance..
 



Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments