문제

YouTube를 통해 재생할 비디오를 시작하려고 하면 UIWebView, 비디오가 열리면 디버거에서 다음과 같이 말합니다.

[MPAVController] Autoplay: Enabling autoplay
[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)

비슷한 질문은 다음과 같습니다. MPMoviePlayerController가 몇 초 후에 재생을 중지합니다.

내 유일한 문제는 UIWebView, 설정할 수 없습니다. MPMoviePlayerController 에게 prepareToPlay.적어도 내 지식으로는 그렇지 않습니다.누구든지 이 문제를 해결하는 데 도움을 줄 수 있다면 정말 좋을 것입니다!

도움이 되었습니까?

해결책

iOS6에서 동일한 문제에 직면 해왔다. your youtube 비디오가 재생 될 때 iOS6 이하의 것입니다.ViewWillDisAppear 메서드는 전화하지 않았습니다. iOS6에서는 YouTube 비디오 재생이 언제든지 전화를 걸 수 있습니다. 이번에는 버그가 될 수 있습니다.

나는 아래와 동일하게 고정되어있다.

전체 화면 항목에 대한 알림을 설정하고 종료 알림을 사용하여 일부 코드의 실행을 피하기 위해 일부 플래그 값을 설정할 수 있습니다.

// For FullSCreen Entry 

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeVideofullScreen:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];

// For FullSCreen Exit
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeVideoExit:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];


- (void)youTubeVideofullScreen:(id)sender
   {   //Set Flag True.
      isFullscreen = TRUE;

   }

- (void)youTubeVideoExit:(id)sender
 {
      //Set Flag False.
     isFullscreen = FALSE;
 }


-(void)viewWillDisappear:(BOOL)animated{
   //Just Check If Flag is TRUE Then Avoid The Execution of Code which Intrupting the Video Playing.
 if(!isFullscreen)
   //here avoid the thing which you want. genrally you were stopping the Video when you will leave the This Video view.
   [super viewWillDisappear:animated];
 }
.

나는 그것이 당신에게 도움이 될 것이라고 확신합니다.

다른 팁

방금 우리 앱 중 하나에서 이와 동일한 문제가 발생했습니다.알고 보니 우리는 UIWebView의 HTML을 빈 문자열로 -(void)viewWillDisappear.분명히 이 메소드는 이제 iOS 6에서 전체 화면 비디오를 표시할 때 호출됩니다. UIWebView, 아마도 문제가 발생한 곳이 바로 여기일 것입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top