Android Google Cast:加载元数据错误,不存在访问控制允许源标题

Android Google Cast:加载元数据错误,不存在访问控制允许源标题,android,stream,cors,google-cast,Android,Stream,Cors,Google Cast,我试着用我的Android应用程序播放流。 该流来自我自己网络中的Sat接收器。 我通过http链接访问流,如: http://192.168.188.23:8001/1:0:19:283D:3FB:1:C00000:0 当我在VLC中打开流时,我得到以下编解码器信息: 类型:视频/ 编解码器:H264-MPEG-4AVC(第10部分)(H264) 在我的应用程序中,我构建了以下MediInfo: private static MediaInfo buildMediaInfo(String t

我试着用我的Android应用程序播放流。 该流来自我自己网络中的Sat接收器。 我通过http链接访问流,如:

http://192.168.188.23:8001/1:0:19:283D:3FB:1:C00000:0
当我在VLC中打开流时,我得到以下编解码器信息:

类型:视频/ 编解码器:H264-MPEG-4AVC(第10部分)(H264)

在我的应用程序中,我构建了以下MediInfo:

private static MediaInfo buildMediaInfo(String title, String subTitle, String studio, String url, String imgUrl, String bigImageUrl, List<MediaTrack> tracks) {
    MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
    movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, subTitle);
    movieMetadata.putString(MediaMetadata.KEY_TITLE, title);
    movieMetadata.putString(MediaMetadata.KEY_STUDIO, studio);
    return new MediaInfo.Builder(url)
            .setStreamType(MediaInfo.STREAM_TYPE_LIVE)
            .setContentType("video/mp4")
            .setMetadata(movieMetadata)
            .setMediaTracks(tracks)
            .build();
}
我无法在流本身更改某些内容

这是我的代码中的问题还是来自我的Sat接收器(流)的问题&当它是来自我的Sat接收器的问题时,有解决方案吗

编辑:

解决CORS问题后,新的错误日志:

Failed to load resource: the server responded with a status of 404 (Not Found) https://www.gstatic.com/eureka/player/undefined
 [  0.280s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc cast_receiver.js:18
The page at 'https://www.gstatic.com/eureka/player/player.html?skin' was loaded over HTTPS, but ran insecure content from 'ws://localhost:8008/v2/ipc': this content should also be loaded over HTTPS.
 player.html:1
Connecting to a non-secure WebSocket server from a secure origin is deprecated. player.html:1
 [  0.367s] [goog.net.WebSocket] WebSocket opened on ws://localhost:8008/v2/ipc cast_receiver.js:18
Failed to load resource: the server responded with a status of 404 (Not Found) https://www.gstatic.com/eureka/player/undefined
The page at 'https://www.gstatic.com/eureka/player/player.html?skin' was loaded over HTTPS, but displayed insecure content from 'http://192.168.188.32/teststream1.php': this content should also be loaded over HTTPS.
 cast_receiver.js:55
 [ 12.071s] [cast.receiver.MediaManager] Load metadata error cast_receiver.js:18
 nb cast_receiver.js:18
 kb.Yb cast_receiver.js:18
 B.log cast_receiver.js:13
 I cast_receiver.js:16
 Z.ra cast_receiver.js:88
 g.ra cast_receiver.js:53
 Ib cast_receiver.js:23
 Fb cast_receiver.js:24
 (anonymous function) cast_receiver.js:21
编辑2: 流中的标头如下所示(使用php捕获):

当我在VLC中打开流时,我得到以下编解码器信息:

类型:视频/ 编解码器:H264-MPEG-4AVC(第10部分)(H264)

Android代码同上

接收人:

编辑3

使用自定义样式的适配器和优化的代码:

错误日志转换:

cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);
undefined
 [405.177s] [cast.receiver.IpcChannel] Received message: {"data":"{\"currentTime\":0,\"type\":\"LOAD\",\"media\":{\"streamType\":\"BUFFERED\",\"duration\":0,\"contentType\":\"video\\/mpeg\",\"contentId\":\"http:\\/\\/192.168.188.32\\/teststream1.php\",\"metadata\":{\"subtitle\":\"Auslandskorrespondenten berichten\",\"studio\":\"Das Erste HD\",\"title\":\"Weltspiegel\",\"metadataType\":1}},\"requestId\":2,\"autoplay\":true}","namespace":"urn:x-cast:com.google.cast.media","senderId":"229:de.resper.e2cast-22"} cast_receiver.js:18
 [405.187s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18
 [405.193s] [cast.receiver.MediaManager] MediaManager message received cast_receiver.js:18
 [405.198s] [cast.receiver.MediaManager] Dispatching MediaManager load event cast_receiver.js:18
 [406.017s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"setappstate\",\"statusText\":\"Now Casting: Weltspiegel\"}"} cast_receiver.js:18
 [406.046s] [cast.receiver.MediaManager] Load - contentId: http://192.168.188.32/teststream1.php autoplay: true time: 0 cast_receiver.js:18
The page at 'https://www.gstatic.com/eureka/player/player.html?skin' was loaded over HTTPS, but displayed insecure content from 'http://192.168.188.32/teststream1.php': this content should also be loaded over HTTPS.
 cast_receiver.js:55
 [408.624s] [cast.receiver.MediaManager] Load metadata error cast_receiver.js:18nb cast_receiver.js:18kb.Yb cast_receiver.js:18B.log cast_receiver.js:13I cast_receiver.js:16Z.ra cast_receiver.js:88g.ra cast_receiver.js:53Ib cast_receiver.js:23Fb cast_receiver.js:24(anonymous function) cast_receiver.js:21
 [409.519s] [cast.receiver.MediaManager] Sending error message to 229:de.resper.e2cast-22 cast_receiver.js:18
 [409.523s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"229:de.resper.e2cast-22","data":"{\"requestId\":2,\"type\":\"LOAD_FAILED\"}"} cast_receiver.js:18
 [410.301s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"setappstate\",\"statusText\":\"Ready To Cast\"}"} cast_receiver.js:18

我在你的帖子里没有看到任何问题,所以我不确定你到底在问什么;您提到的错误表明您遇到了chromecast(基于W3C要求)所要求的CORS问题,您无法从Cast SDK方面解决该问题。

我添加了上述问题。那么,从我的应用程序或我的演员接收器来看,这没有问题吗?在我的Android设备上,我可以毫无问题地播放流。CORS是chromecast播放流时需要满足的要求,通常是从提供内容的服务器添加的。一旦你通过了这一点,你就可以看到是否还有其他问题,但到目前为止,你的第一个阻塞问题是修复CORS问题。如果您可以控制为您的内容提供服务的服务器,那么您应该能够添加CORS头。我可以将CORS添加到流中。现在我不再收到CORS错误,但加载元数据错误仍然存在…您使用的是什么接收器?这个:
[0] => HTTP/1.0 200 OK
[1] => Date: Sat, 04 Oct 2014 18:38:23 GMT
[2] => Server: Apache/2.2.22 (Debian)
[3] => X-Powered-By: PHP/5.4.4-14+deb7u9
[4] => Connection: Close
[5] => Access-Control-Allow-Origin: *
[6] => Content-Type: video/mpeg
cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);
undefined
 [405.177s] [cast.receiver.IpcChannel] Received message: {"data":"{\"currentTime\":0,\"type\":\"LOAD\",\"media\":{\"streamType\":\"BUFFERED\",\"duration\":0,\"contentType\":\"video\\/mpeg\",\"contentId\":\"http:\\/\\/192.168.188.32\\/teststream1.php\",\"metadata\":{\"subtitle\":\"Auslandskorrespondenten berichten\",\"studio\":\"Das Erste HD\",\"title\":\"Weltspiegel\",\"metadataType\":1}},\"requestId\":2,\"autoplay\":true}","namespace":"urn:x-cast:com.google.cast.media","senderId":"229:de.resper.e2cast-22"} cast_receiver.js:18
 [405.187s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message cast_receiver.js:18
 [405.193s] [cast.receiver.MediaManager] MediaManager message received cast_receiver.js:18
 [405.198s] [cast.receiver.MediaManager] Dispatching MediaManager load event cast_receiver.js:18
 [406.017s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"setappstate\",\"statusText\":\"Now Casting: Weltspiegel\"}"} cast_receiver.js:18
 [406.046s] [cast.receiver.MediaManager] Load - contentId: http://192.168.188.32/teststream1.php autoplay: true time: 0 cast_receiver.js:18
The page at 'https://www.gstatic.com/eureka/player/player.html?skin' was loaded over HTTPS, but displayed insecure content from 'http://192.168.188.32/teststream1.php': this content should also be loaded over HTTPS.
 cast_receiver.js:55
 [408.624s] [cast.receiver.MediaManager] Load metadata error cast_receiver.js:18nb cast_receiver.js:18kb.Yb cast_receiver.js:18B.log cast_receiver.js:13I cast_receiver.js:16Z.ra cast_receiver.js:88g.ra cast_receiver.js:53Ib cast_receiver.js:23Fb cast_receiver.js:24(anonymous function) cast_receiver.js:21
 [409.519s] [cast.receiver.MediaManager] Sending error message to 229:de.resper.e2cast-22 cast_receiver.js:18
 [409.523s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"229:de.resper.e2cast-22","data":"{\"requestId\":2,\"type\":\"LOAD_FAILED\"}"} cast_receiver.js:18
 [410.301s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"setappstate\",\"statusText\":\"Ready To Cast\"}"} cast_receiver.js:18