Model 如何在接收机中检测色度模型?

Model 如何在接收机中检测色度模型?,model,device,chromecast,receiver,Model,Device,Chromecast,Receiver,我只找到了如何使用castapi获取sdk版本。有没有办法检测接收器运行的是哪种型号的chromecast?第一代?第二极端的 谢谢。否,没有API返回正在运行的cast设备的型号或版本。您可以在发送方检测型号名称 “Chromecast”、“Chromecast Ultra”没有名字,但你能猜到吗 DeviceCapabilities->IS_HDR_SUPPORTED=较新的设备 castReceiverManager = cast.receiver.CastReceiverManager.

我只找到了如何使用castapi获取sdk版本。有没有办法检测接收器运行的是哪种型号的chromecast?第一代?第二极端的


谢谢。

否,没有API返回正在运行的cast设备的型号或版本。

您可以在发送方检测型号名称
“Chromecast”、“Chromecast Ultra”没有名字,但你能猜到吗

DeviceCapabilities->IS_HDR_SUPPORTED=较新的设备

castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
castReceiverManager.getDeviceCapabilities()
// gives: is_hdr_supported = false, on first generation

我创建了一个用于报告的自定义typescript类。我们使用它来根据设备支持的内容准确检测用户正在使用的设备。这可能不适用于Android TV

private supported720PWidth = 1280;
private supported720PHeight = 720;
private supported1080PWidth = 1920;
private supported1080PHeight = 1080;
private supported2160PWidth = 3840;
private supported2160pHeight = 2160;
private mp4 = 'video/mp4';
private codecH264Lvl4Dot1 = 'avc1.640028';
private codecH264Lvl4Dot2 = 'avc1.64002A';
private firstGenLastSupportedOS = '1.36';
private codecH265 = 'hev1.1.6.L150.B0'
private context = CastReceiverContext.getInstance()



//https://developers.google.com/cast/docs/media#audio_passthrough we use codec because each device has a limitation so makes this as accurate as it can be
public isDeviceUltra(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH265, this.supported2160PWidth, this.supported2160pHeight, 30);
}

public isDevice3rdGen(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH264Lvl4Dot2, this.supported1080PWidth, this.supported1080PHeight, 60);
}

public isDevice2ndGen(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH264Lvl4Dot1, this.supported1080PWidth, this.supported1080PHeight, 30);
}

public isDevice1stGen(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH264Lvl4Dot1, this.supported1080PWidth, this.supported1080PHeight) && this.isOSLowerThanOrEqual(this.firstGenLastSupportedOS);
}

public isDeviceNestHub(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH264Lvl4Dot1, this.supported720PWidth, this.supported720PHeight, 60);
}

public isDeviceNestHubMax(): boolean {
    return this.context.canDisplayType(this.mp4, this.codecH264Lvl4Dot1, this.supported720PWidth, this.supported720PHeight, 30);
}

private getDevicesOSVersion(): string {
    let userAgent = navigator.userAgent.toString();
    let userAgentSplit = userAgent.split('/', 8);
    let fullOS = userAgentSplit[userAgentSplit.length - 1];
    return fullOS;
}

private isOSLowerThanOrEqual(expectedOS: string): boolean {
    let os = this.getDevicesOSVersion().split('.', 2);
    let expectedOSArray = expectedOS.split('.', 2);
    if (Number(os[1]) <= Number(expectedOSArray[1])) {
        return true;
    } else {
        return false;
    }
}
private-supported720PWidth=1280;
私人支持720Pheight=720;
私人支持1080pWidth=1920;
私人支持1080Pheight=1080;
私人支持2160pWidth=3840;
私人支持2160Pheight=2160;
专用mp4=‘视频/mp4’;
专用编解码器h264lvl4dot1='avc1.640028';
专用编解码器h264lvl4dot2='avc1.64002A';
private firstGenLastSupportedOS='1.36';
私有codecH265='hev1.1.6.L150.B0'
private context=castrecivercontext.getInstance()
//https://developers.google.com/cast/docs/media#audio_passthrough 我们使用编解码器,因为每个设备都有一个限制,所以尽可能精确
public isDeviceUltra():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH265,this.supported2160PWidth,this.supported2160pEight,30);
}
public isDevice3rdGen():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH264Lvl4Dot2,this.supported1080PWidth,this.supported1080pEight,60);
}
public isDevice2ndGen():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH264Lvl4Dot1,this.supported1080PWidth,this.supported1080pEight,30);
}
public isDevice1stGen():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH264Lvl4Dot1,this.supported1080PWidth,this.supported1080pEight)和&this.isOSLowerThanOrEqual(this.firstGenLastSupportedOS);
}
public isDeviceNet Hub():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH264Lvl4Dot1,this.supported720PWidth,this.supported720pEight,60);
}
public isDeviceTestHubMax():布尔值{
返回this.context.canDisplayType(this.mp4,this.codecH264Lvl4Dot1,this.supported720PWidth,this.supported720pEight,30);
}
私有getDevicesOSVersion():字符串{
让userAgent=navigator.userAgent.toString();
让userAgentSplit=userAgent.split('/',8);
设fullOS=userAgentSplit[userAgentSplit.length-1];
返回fullOS;
}
私有isOSLowerThanOrEqual(预期为:字符串):布尔值{
让os=this.getDevicesOSVersion().split('.',2);
设expectedOSArray=expectedOS.split('.',2);

如果(操作系统编号[1])这是为什么?我如何识别我运行的是Ultra,例如,我可以启动4K的HEVC流?同样,索尼安卓电视不应该播放高帧率内容。我也想知道这是否有原因?这是谷歌试图禁止的吗?有没有其他API可以用来播放这些内容版本是什么?欢迎使用StackOverflow!如果您能提供更多详细信息、解释和/或示例代码,您将提高帮助询问者并获得帮助的机会。虽然它过滤掉了第一代,但它没有区分v2和ulta:(是的,这是真的。最好是让发送者发送型号名称,因为:“当前设置的HDR视频支持(即,Chromecast及其连接的电视)。”。但这也只是提供了Chromecast或Chromecast Ultra。然后,通过检查蓝牙支持,很可能会区分v1和v2。Chromecast Ultra显示的值不正确