0

I'm streaming audio livestreams and audio on-demand m3u8 files from my iOS sender app to the chromecast. When doing so, the receivers screen is black and not showing any information about the current streamed audio. Only when the stream is paused, the information is shown. Is there any way to show the audio information while playing the audio? If mp3 files are streamed to the chromecast, the audio information is shown in playing and paused state.

I'm using the Cast 4.0.1 SDK, this is my media setup:

    // setup metadata with playback information

    let metadata = GCKMediaMetadata(metadataType: GCKMediaMetadataType.musicTrack)

    metadata.setString(playback.title, forKey: kGCKMetadataKeyTitle)
    metadata.setString(playback.subtitle, forKey: kGCKMetadataKeyArtist)
    metadata.addImage(GCKImage(url: playback.imageSmall, width: 1024, height: 1024))

    let streamType: GCKMediaStreamType = .buffered
    let contentType: String            = "application/vnd.apple.mpegurl"
    let duration: Double               = playback.duration

    let mediaInfo = GCKMediaInformation(contentID: streamURL.absoluteString, streamType: streamType, contentType: contentType, metadata: metadata, streamDuration: duration, mediaTracks: nil, textTrackStyle: nil, customData: nil)

    // seek to start position

    let mediaLoadOptions = GCKMediaLoadOptions()
    mediaLoadOptions.playPosition = playPosition

    // load media and start playback

    let request = session.remoteMediaClient?.loadMedia(mediaInfo, with: mediaLoadOptions)
    request?.delegate = self
dalipsia
  • 186
  • 1
  • 7

2 Answers2

0

You should use the Chrome Remote Debugger to determine if there are any errors or debug information that will explain the issue you are seeing.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • no errors, no warnings in the chrome remote debugger while streaming. IPC message sent is `...,\"contentType\":\"application/vnd.apple.mpegurl\",\"streamType\":\"LIVE\",\"duration\":null,\"tracks\":[{\"trackId\":1,\"trackContentType\":\"video/mp2t\",\"type\":\"VIDEO\"}}...` There shouldn't be any video type references, but audio only. In the setup I haven't provided any mediaTracks information. – dalipsia Dec 12 '17 at 14:16
  • It might be an SDK bug. Please file an issue: https://issuetracker.google.com/issues?q=componentid:190205%20status:open&s=modified_time:desc – Leon Nicholls Dec 12 '17 at 21:05
  • @LeonNicholls, could you please conclude my comment after Ali Naddaf comment? https://stackoverflow.com/questions/41499247/screen-mirrorring-using-chrome-cast-example-code-or-tutorial – Jamshed Alam May 20 '21 at 03:28
0

Not sure about this but you need to use a custom receiver in order to use remote debugging and you may not have added the code to your custom receiver to display what you want.

Try changing to the default receiver. If that displays what you want then try adding more display code to your custom receiver. If it doesn't then try adding more metadata to your mediaInfo.

Julian
  • 1,522
  • 11
  • 26