objective c - iphone MediaPlayerController does not show the media player -
hi,
i developing app contains 3 tab view control. 1 each audio, video , images.
when select video tab, have items displayed in table view format on selection of cell, video shown. example.
(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { mpmovieplayercontroller *movieplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:[nsurl urlwithstring:url]] ; [movieplayer play]; }
the problem though able play video unable see video , can hear audio. in addition, if close app while video playing, , start app, application crashes.
can please let me know how should go ahead ?
after spending more time, have found out version above 3.2 1 has use mpmovieplayerviewcontroller.
the use of same resolved issue.
if ([[[uidevice currentdevice] systemversion ] doublevalue] >= 3.2) { mpmovieplayerviewcontroller *mediaplayer = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:[nsurl urlwithstring:urladdress]]; if (mediaplayer) { [self presentmovieplayerviewcontrolleranimated:mediaplayer]; mediaplayer.movieplayer.moviesourcetype = mpmoviesourcetypefile ; [mediaplayer.movieplayer play]; [mediaplayer release]; } }
Comments
Post a Comment