ios - MPMoviePlayerController audio not playing on device but plays on simulator -
i have mpmovieplayercontroller in ios app streams video amazon s3. video plays fine, seems on device (i tested ios 6, not sure others), audio doesn't play. audio works fine on emulator, not on device.
anyone have ideas what's wrong? here's code:
// construct video's url nsurl *url = [nsurl urlwithstring:[nsstring stringwithformat:@"http://s3.amazonaws.com/<mybucket>/%d.m4v",videofilenumber]]; vidplayer = [[mpmovieplayercontroller alloc] initwithcontenturl: url]; // set video player [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:) name:mpmovieplayerplaybackdidfinishnotification object:vidplayer]; vidplayer.scalingmode = mpmoviescalingmodeaspectfill; vidplayer.controlstyle = mpmoviecontrolstyledefault; vidplayer.shouldautoplay = yes; [self.view addsubview:vidplayer.view]; [vidplayer setfullscreen:yes animated:yes]; thank you!
you forgot preparetoplay. call absolutely essential. i'm not saying solve problem, might, , absolutely must call on modern ios systems.
also: find out what's going wrong, exactly, must register notifications. mpmovieplayerplaybackdidfinishnotification good, urge regiter @ least mpmovieplayerloadstatedidchangenotification well.
in addition, have suggest since audio not playing video playing, might want concern format of audio contained within movie. device has surprising hidden limitations on audio formats can play: overly compressed audio, example, can give trouble.
Comments
Post a Comment