원격 URL에 대한 MPMoviePlayerController 인스턴스를 시작하면 맨 위의 막대에 "Loading Movie ..."가 표시됩니다.이 메시지를 사용자 정의로 변경할 수 있습니까?MPMoviePlayerController에서 "Loading Movie ..."메시지를 어떻게 바꿀 수 있습니까?
1
A
답변
2
표시 할 이미지 (또는 레이블 또는 다른 것)로 UIImageView를 만들고 MoviePlayerControllerView에 추가하기 만하면됩니다. 보기 플레이어를 추가 할 논리를 수행
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movie.trailerURL];
if ([moviePlayer respondsToSelector:@selector(loadState)]) {
[moviePlayer prepareToPlay];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerLoadStateChanged:) name:MPMoviePlayerLoadStateDidChangeNotification object:moviePlayer];}
을 다음 알림 방법 :
UIImage *loadingScreenImage = [UIImage imageNamed:@"loadingScreen.png"];
loadingScreen = [[UIImageView alloc] initWithImage:loadingScreenImage]; // ivar & property are declared in the interface file
[self.view addSubview:loadingScreen];
[loadingScreen release];
그런 다음 동영상 플레이어를 인스턴스화 및 LoadState가 변경 될 때 알림을받을 등록 할 수 있습니다
- (void) moviePlayerLoadStateChanged:(NSNotification*)notification
{
// Unless state is unknown, start playback
switch ([moviePlayer loadState]) {
case MPMovieLoadStateUnknown:
break;
case MPMovieLoadStatePlayable:
// Remove observer
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerLoadStateDidChangeNotification
object:nil];
// Set frame of movie player
[moviePlayer.view setFrame:CGRectMake(0, 0, 480, 320)];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setFullscreen:YES animated:YES];
[self.view addSubview:[moviePlayer view]];
// Play the movie
[moviePlayer play];
...
}
+0
이것은 앱의 오프닝 비디오 재생을 만드는 가장 작은 효과입니다. – Shiny
관련 문제
- 1. doctrine의`invalid` 메시지를 어떻게 바꿀 수 있습니까?
- 2. jqGrid loading .. 메시지를 어떻게 트리거 할 수 있습니까?
- 3. 테두리를 어떻게 바꿀 수 있습니까?
- 4. EditText를 어떻게 바꿀 수 있습니까?
- 5. 어떻게 axis.jar을 바꿀 수 있습니까?
- 6. 어떻게 메시지를 보낼 수 있습니까?
- 7. MPMoviePlayerController에서 메모리 누수가 발생했습니다.
- 8. Javahelp 글꼴은 어떻게 바꿀 수 있습니까?
- 9. 목록의 요소는 어떻게 바꿀 수 있습니까?
- 10. 사각형이 이동하는 방향을 어떻게 바꿀 수 있습니까?
- 11. 내 TabHost를 어떻게 바꿀 수 있습니까?
- 12. UIPopoverController의 테두리 색을 어떻게 바꿀 수 있습니까?
- 13. PHP Permalinks .. 어떻게 바꿀 수 있습니까?
- 14. 어떻게 mysql에서 데이터베이스의 이름을 바꿀 수 있습니까?
- 15. 런타임에서 마스터 페이지를 어떻게 바꿀 수 있습니까?
- 16. OpenID의 ReturnUrl을 어떻게 바꿀 수 있습니까?
- 17. QDateEdit에서 요일을 어떻게 바꿀 수 있습니까?
- 18. TCanvas의 textOut 높이를 어떻게 바꿀 수 있습니까?
- 19. InkCanvas에서 그릴 방법을 어떻게 바꿀 수 있습니까?
- 20. Formtastic에서 사용되는 방법을 어떻게 바꿀 수 있습니까?
- 21. json string을 어떻게 바꿀 수 있습니까?
- 22. ggplot2 범례의 제목은 어떻게 바꿀 수 있습니까?
- 23. ct100이란 무엇이며 이름을 어떻게 바꿀 수 있습니까?
- 24. LWJGL 창 크기를 어떻게 바꿀 수 있습니까?
- 25. SVG에서 텍스트의 방향을 어떻게 바꿀 수 있습니까?
- 26. Android에서 런타임에서 백그라운드를 어떻게 바꿀 수 있습니까?
- 27. 마우스 커서 이미지를 어떻게 바꿀 수 있습니까?
- 28. Maple의 행렬 요소를 어떻게 바꿀 수 있습니까?
- 29. 문자열에서 "/"를 "\ /"로 어떻게 바꿀 수 있습니까?
- 30. JQGrid에서 배경색과 글꼴을 어떻게 바꿀 수 있습니까?
이 문제에 대한 해결책이 있었습니까? –
아니, 기억하지. – jasondoucette