gpt4 book ai didi

ios - 将 .m3u8 从 iOS 直播到 Chromecast

转载 作者:行者123 更新时间:2023-11-28 19:42:18 24 4
gpt4 key购买 nike

根据 Google 的文档,我可以将 .mp4 和 .m3u8 流式传输到我的 Chromecast。当我尝试转换实时流时,转换图标逐渐消失,然后在一秒钟后重新出现。

这是一个有效的点播流:

GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"
streamType:GCKMediaStreamTypeLive
contentType:@"application/x-mpegURL"
metadata:[self getMetadata]
streamDuration:INFINITY
customData:nil];

这是一个无法正常工作的直播。

GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
@"http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8"
streamType:GCKMediaStreamTypeLive
contentType:@"application/x-mpegURL"
metadata:[self getMetadata]
streamDuration:INFINITY
customData:nil];

我已经在 VLC 中测试了这两个以确保流实际上是事件的。

最佳答案

第二个流没有 CORS header ,这是 Chromecast 上自适应内容的要求。您可以通过调用 curl -v <url> 来检查然后检查 header :

$ curl -v http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8
* Trying 8.253.43.126...
* Connected to vevoplaylist-live.hls.adaptive.level3.net (8.253.43.126) port 80 (#0)
> GET /vevo/ch1/appleman.m3u8 HTTP/1.1
> Host: vevoplaylist-live.hls.adaptive.level3.net
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: max-age=2
< Date: Tue, 24 Nov 2015 15:44:12 GMT
< Content-Length: 427
< Content-Type: application/vnd.apple.mpegurl
< ETag: "6880298-1ab-51c1fc3e9da00"
< Last-Modified: Thu, 30 Jul 2015 23:07:20 GMT
< Accept-Ranges: bytes
< Server: Footprint Distributor V4.11
< Vary: Accept-Encoding
< Expires: Tue, 24 Nov 2015 15:44:14 GMT
< Connection: keep-alive

如果你对第一个(有效)做同样的事情,你会得到:

$ curl -v http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
* Trying 23.67.247.168...
* Connected to qthttp.apple.com.edgesuite.net (23.67.247.168) port 80 (#0)
> GET /1010qwoeiuryfg/sl.m3u8 HTTP/1.1
> Host: qthttp.apple.com.edgesuite.net
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: Apache
< ETag: "2b476bddec5a6410f01593dd3244bb86:1299516757"
< Last-Modified: Mon, 07 Mar 2011 16:52:37 GMT
< Content-Length: 940
< Expires: Tue, 24 Nov 2015 15:47:02 GMT
< Cache-Control: max-age=0, no-cache, no-store
< Pragma: no-cache
< Date: Tue, 24 Nov 2015 15:47:02 GMT
< Connection: keep-alive
< Set-Cookie: AKID=650047DEB61A8134C38CECC9EC836DF8;expires=Fri, 11-27-2015 00:00:00 GMT; path=/; domain=qthttp.apple.com.edgesuite.net
< Content-Type: application/x-mpegURL
< Access-Control-Allow-Origin: *
< Set-Cookie: CLIENT_SESSION_COOKIE=csid=235AB97C3466663B398A6EC6DA38428C#ct=1448380022#master=sl.m3u8; path=/1010qwoeiuryfg; domain=qthttp.apple.com.edgesuite.net
< Set-Cookie: CLIENT_VIEWER_COOKIE=78FCBFC2DF7B7BD10F99EEC583042328;expires=Tue, 10-06-2014 00:00:00 GMT; path=/; domain=qthttp.apple.com.edgesuite.net

注意 Access-Control-Allow-Origin: * 的存在在第二个而不是第一个。

关于ios - 将 .m3u8 从 iOS 直播到 Chromecast,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33895802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com