我们正在尝试播放仅音频的HLS实时流。 从规格角度来看,它看起来还可以,我们可以在所有浏览器和本机播放器上播放它,但无法在Chromecast上播放。
网址:http://rcavliveaudio.akamaized.net/hls/live/2006635/P-2QMTL0_MTL/playlist.m3u8
内容类型:vnd.apple.mpegURL
复制步骤 强制将此内容网址和内容类型放入Chromecast播放器。
预期 要尝试像在其他播放器上一样播放音频,我们会尝试。
实际结果 没有播放。获取主播放列表,获取块播放列表,并获取第一个块,但是没有播放。几块之后停止。 播放器停留在“处理段”阶段,然后停止。
答案 0 :(得分:1)
请将内容类型更改为音频/ mp4,并将AAC设置为段格式mediaInfo.hlsSegmentFormat = cast.framework.messages.HlsSegmentFormat.AAC;
答案 1 :(得分:0)
使用Anjaneesh的评论,这就是我最终解决此问题的方式。在接收者的JavaScript上:
library(dplyr)
mydat %>% mutate(across(-all_of(col), ~0))
关键是为 const instance = cast.framework.CastReceiverContext.getInstance();
const options = new cast.framework.CastReceiverOptions();
options.disableIdleTimeout = true;
options.supportedCommands = cast.framework.messages.Command.ALL_BASIC_MEDIA;
instance.start(options);
const playerManager = instance.getPlayerManager();
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, (req) => {
req.media.hlsSegmentFormat = cast.framework.messages.HlsSegmentFormat.TS_AAC;
req.media.streamType = cast.framework.messages.StreamType.LIVE;
return req;
});
事件/消息设置消息拦截器回调。在那里,您可以从客户端覆盖LOAD
。就我而言,我需要指出我的细分受众群采用的是TS格式。
我不确定为什么需要这样做。有视频轨道是没有必要的……只有在视频丢失时。