ios - MPMoviePlayerController sometimes plays audio, not video when fading in -
I got an issue where I have many views in a UIScrollView (the video controller below) that works The page for the video content (initially a thumbnail view is shown).
Occasionally (but not always) When I scroll to the next page, audio plays for the video but I do not get any views. This does not seem to happen when I am not extending this scene.
The Video Init Code is:
MP4 Player MP4 Player Movie Player = [[MP3 MPV Player Controller Illock] INS]; Self.movieplayer = movieplayer; [Movie Player Set Control Style: MPMVE Control Stylon]; [Movie Player Set ReplayMod: MP3 MP4RipPadMod on]; [Movieplayer.view setframe: CGRactMake (0, 0, self.vi.fr.width, selfview.frame sizeHight)]; Movie player Background View.backgroundColor = [UIColor clear collar]; Movie player.movie source type = mpmv sourceotype streaming; MoviePlayer.contentURL = [NSD URL URL with string: [videoData.video src]]; [Self. Video Controller See Adsviewview: Self Movie Players. Weave]; [Self. Video Controller See Laosvivio Toufront: Movie Player. See]; [Movie player.view set alpha: 0.0f]; // Movie Observer [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @Selector (checkmovestats :) Name: MPVplayer LoadedTraded Change Notification Item: Zero]; // Add Tap Handler UITapGestureRecognizer * singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget: Self-action: @selector (onPlayerTapped :)]; SingleFingerTap.numberOfTapsRequired = 1; SingleFingerTap.delegate = self; [M.MoviePlayer.ViewEdistineRecognizer: SinglefyingTap]; [For movieplayer preparation];
and play code (to try to avoid black flash at the beginning of the video):
- (zero) checkmoviectats: (NSNotification * ) Notification {if (self movie player. RFFordisplay and MP MPVOoldStatePayBable | MPV loadstate playthrough OK)) [[Self-movieplayer play]; [[NSNotificationCenter defaultCenter] DeleteAbSverver: Own name: MPMVplayerStandardStateDid Change Notification Object: Zero]; [UIView AnimatedDiscussion: 0.4F Animation: ^ {[Self. Movie player Set set alpha: 1.0f]; } Closing: ^ (BOOL End) {//self.movieplayer play]; // tried here as well}]; }}
The code to extract a video view on the scroll is:
- Delete (zero) movieplayer {if (self movieplayer} {[ Movieplayer stop]; [Self. Movie Player.ViewingPropowerView]; Self. Movie player = zero; }}
I find this problem very strange. In my case I will swipe the video and play the audio and there will be no picture. If I went away and came back, everything worked fine, just for its fun I tried
MPMoviePlayerController * mp = [self.arrayOfScrollView objectAtIndex: xx]; [MP3 Play]; [Mp3 stop]; [MP3 Play];
It is surprising that the work was done because you posted six months ago, if you have found another alternative solution, then I would love to know it.
Comments
Post a Comment