Reputation: 1
I used Broadcast Extension for screen recording on ios device. But I don't know how to stream ios device screen to smart TV on same wifi network?
Upvotes: 0
Views: 1125
Reputation: 11
I have written content to HTTPStream (CMSampleBuffer), I use this URL and cast to TV, it doesn't work.
let url = URL.init(string: "abc.m38u")!
let mediaInfoBuilder = GCKMediaInformationBuilder.init(contentURL: url)
mediaInfoBuilder.streamType = GCKMediaStreamType.buffered
mediaInfoBuilder.contentID = mediaURL.absoluteString
mediaInfoBuilder.contentType = mediaURL.mimeType()
mediaInfoBuilder.hlsSegmentFormat =.TS
mediaInfoBuilder.hlsVideoSegmentFormat=.MPEG2_TS
//mediaInfoBuilder.streamDuration = .infinity
The errors is : -Error Domain=com.google.cast.GCKError Code=30 "Media failed to load" UserInfo={NSLocalizedDescription=Media failed to load, gck_detailed_error_code=301} -[GCKMediaControlChannel didReceiveTextMessage:] - Received unexpected error: INVALID_REQUEST -[GCKMediaQueue request:didFailWithError:] - error fetching queue item IDs: Error Domain=com.google.cast.GCKError Code=4 "Invalid request" UserInfo={gck_error_reason=INVALID_MEDIA_SESSION_ID, NSLocalizedDescription=Invalid request, gck_custom_data=INVALID_MEDIA_SESSION_ID}
How can I fix that.
In addition, using "HLS" content will be delayed 5 to 10 seconds compared to iPhone. Besides using "HLS", is there any other way?
Thanks.
Upvotes: 0
Reputation: 4746
Technique:
Your TV media player will play the screen record.
You can do a research with HaishinKit
for detail.
Upvotes: 0
Reputation: 11
Connect your device to the same Wi-Fi network as your Apple TV or AirPlay 2-compatible smart TV. Find the video that you want to stream. Tap AirPlay . In some apps, you might need to tap a different icon first.* In the Photos app, tap Share , then tap AirPlay . Choose your Apple TV or AirPlay 2-compatible smart TV. To stop streaming, tap AirPlay in the app that you're streaming from, then tap your iPhone, iPad, or iPod touch from the list.
Upvotes: 1