Google Chrome не воспроизводит видео - PullRequest
0 голосов
/ 05 июня 2018

Я разрабатываю приложение для iOS для трансляции видео через Chromecast из приложения iPhone-iOS.Интегрированный Google Chrome Cast SDKv4.Кнопка Cast обнаруживает приемники, но не отображает видео, но видео воспроизводится на iPhone

NSURL *videoURL = [NSURL URLWithString:@"https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/mp4/DesigningForGoogleCast.mp4"];

AVPlayerItem *item = [AVPlayerItem playerItemWithURL:videoURL];
player = [AVPlayer playerWithPlayerItem:item];
AVPlayerViewController *controller = [[AVPlayerViewController alloc] init];
[self addChildViewController:controller];
[self.view addSubview:controller.view];
controller.view.frame = _localPlayerView.frame;
controller.player = player;
controller.showsPlaybackControls = YES;
player.closedCaptionDisplayEnabled = NO;

GCKMediaMetadata *metadata =
[[GCKMediaMetadata alloc] initWithMetadataType:GCKMediaMetadataTypeMovie          ];
GCKMediaInformation *mediaInfo = [[GCKMediaInformation alloc]
                                  initWithContentID:[videoURL absoluteString]
                                  streamType:GCKMediaStreamTypeBuffered
                                  contentType:@"video/mp4"
                                  metadata:metadata
                                  streamDuration:100
                                  mediaTracks:nil
                                  textTrackStyle:nil
                                  customData:nil];

GCKCastSession *session =
[GCKCastContext sharedInstance].sessionManager.currentCastSession;

[[GCKCastContext sharedInstance].sessionManager addListener:self];
[session.remoteMediaClient loadMedia:mediaInfo];
[session start];
...