detect-audio-video
Advanced tools
Comparing version 0.16.0 to 0.17.0
export declare function isMp3Supported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isMp4AudioSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isAacSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDolbyDigitalSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDolbyDigitalPlusSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDolbyAtmosSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isMpegHAudioSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isVorbisSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isFlacSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isOpusSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDtsSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDtsHdSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDtsExpressSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDtsXSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; |
@@ -7,5 +7,7 @@ export declare const H264_BASELINE_CONTENT_TYPE = "video/mp4; codecs=\"avc1.42E01E\""; | ||
export declare const AV1_CONTENT_TYPE = "video/mp4; codecs=\"av01.0.01M.08\""; | ||
export declare const HEVC_MAIN_CONTENT_TYPE = "video/mp4; codecs=\"hev1.1.6.L123.B0\""; | ||
export declare const HEVC_MAIN10_CONTENT_TYPE = "video/mp4; codecs=\"hev1.2.4.L153.B0\""; | ||
export declare const HEV_MAIN_CONTENT_TYPE = "video/mp4; codecs=\"hev1.1.6.L123.B0\""; | ||
export declare const HEV_MAIN10_CONTENT_TYPE = "video/mp4; codecs=\"hev1.2.4.L153.B0\""; | ||
export declare const HVC_MAIN_CONTENT_TYPE = "video/mp4; codecs=\"hvc1.1.6.L123.B0\""; | ||
export declare const HVC_MAIN10_CONTENT_TYPE = "video/mp4; codecs=\"hvc1.2.4.L153.B0\""; | ||
export declare const DOLBY_VISION_CONTENT_TYPE = "video/mp4; codecs=\"dvhe.08.09\""; | ||
export declare const MPEG2T_CONTENT_TYPE = "video/mp2t"; |
@@ -47,3 +47,3 @@ const AAC_CONTENT_TYPE = 'audio/mp4; codecs="mp4a.40.2"'; | ||
function isContentTypeSupported(contentType) { | ||
const canPlayTypeResult = canPlayType(contentType); | ||
const canPlayTypeResult = canPlayType(contentType) !== ''; | ||
const isTypeSupportedResult = isTypeSupported(contentType); | ||
@@ -55,2 +55,3 @@ return { | ||
both: canPlayTypeResult && isTypeSupportedResult, | ||
contentType, | ||
}; | ||
@@ -108,4 +109,7 @@ } | ||
const AV1_CONTENT_TYPE = 'video/mp4; codecs="av01.0.01M.08"'; | ||
const HEVC_MAIN_CONTENT_TYPE = 'video/mp4; codecs="hev1.1.6.L123.B0"'; | ||
const HEVC_MAIN10_CONTENT_TYPE = 'video/mp4; codecs="hev1.2.4.L153.B0"'; | ||
const HEV_MAIN_CONTENT_TYPE = 'video/mp4; codecs="hev1.1.6.L123.B0"'; | ||
const HEV_MAIN10_CONTENT_TYPE = 'video/mp4; codecs="hev1.2.4.L153.B0"'; | ||
// For iOS | ||
const HVC_MAIN_CONTENT_TYPE = 'video/mp4; codecs="hvc1.1.6.L123.B0"'; | ||
const HVC_MAIN10_CONTENT_TYPE = 'video/mp4; codecs="hvc1.2.4.L153.B0"'; | ||
const DOLBY_VISION_CONTENT_TYPE = 'video/mp4; codecs="dvhe.08.09"'; | ||
@@ -133,6 +137,14 @@ const MPEG2T_CONTENT_TYPE = 'video/mp2t'; | ||
function isHevcMainSupported() { | ||
return isContentTypeSupported(HEVC_MAIN_CONTENT_TYPE); | ||
const resultHev = isContentTypeSupported(HEV_MAIN_CONTENT_TYPE); | ||
if (resultHev.any) { | ||
return resultHev; | ||
} | ||
return isContentTypeSupported(HVC_MAIN_CONTENT_TYPE); | ||
} | ||
function isHevcMain10Supported() { | ||
return isContentTypeSupported(HEVC_MAIN10_CONTENT_TYPE); | ||
const resultHev = isContentTypeSupported(HEV_MAIN10_CONTENT_TYPE); | ||
if (resultHev.any) { | ||
return resultHev; | ||
} | ||
return isContentTypeSupported(HVC_MAIN10_CONTENT_TYPE); | ||
} | ||
@@ -581,2 +593,2 @@ function isDolbyVisionSupported() { | ||
export { AAC_CONTENT_TYPE, AV1_CONTENT_TYPE, CLEAR_KEY_SYSTEM, DOLBY_AC3_CONTENT_TYPE, DOLBY_AC4_CONTENT_TYPE, DOLBY_ATMOS_CONTENT_TYPE, DOLBY_EC3_CONTENT_TYPE, DOLBY_VISION_CONTENT_TYPE, DTS_CORE_CONTENT_TYPE, DTS_HD_CORE_PLUS_EXTENSION_CONTENT_TYPE, DTS_HD_LBR_CONTENT_TYPE, DTS_UHD_PROFILE_2_CONTENT_TYPE, DTS_UHD_PROFILE_3_CONTENT_TYPE, FAIRPLAY_KEY_SYSTEM, FAIRPLAY_V1_KEY_SYSTEM, FAIRPLAY_V2_KEY_SYSTEM, FAIRPLAY_V3_KEY_SYSTEM, FLAC_CONTENT_TYPE, H264_BASELINE_CONTENT_TYPE, H264_HIGH_CONTENT_TYPE, H264_MAIN_CONTENT_TYPE, HEVC_MAIN10_CONTENT_TYPE, HEVC_MAIN_CONTENT_TYPE, HLS_CONTENT_TYPE, MP3_CONTENT_TYPE, MP4_AUDIO_CONTENT_TYPE, MPD_CONTENT_TYPE, MPEG2T_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_1_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_1_MULTISTREAM_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_2_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_2_MULTISTREAM_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_MULTISTREAM_CONTENT_TYPE, MSS_CONTENT_TYPE, OPUS_CONTENT_TYPE, PLAYREADY_KEY_SYSTEM, PRIMETIME_KEY_SYSTEM, TTML_CONTENT_TYPE, VORBIS_CONTENT_TYPE, VP8_CONTENT_TYPE, VP9_CONTENT_TYPE, WEBVTT_CONTENT_TYPE, WIDEWINE_KEY_SYSTEM, XHE_AAC_CONTENT_TYPE, canPlayType, defaultVideoElement, getDevicePixelRatio, getGpuRenderer, getGpuVendor, getResolutionBadge, getResolutionMode, getScreenDepth, getScreenHeight, getScreenWidth, is10KScreenSupported, is16KScreenSupported, is2KScreenSupported, is2dot5KScreenSupported, is32KScreenSupported, is4KScreenSupported, is5KScreenSupported, is6KScreenSupported, is8KScreenSupported, isAV1Supported, isAacSupported, isClearKeySupported, isContentTypeSupported, isDolbyAtmosSupported, isDolbyDigitalPlusSupported, isDolbyDigitalSupported, isDolbyVisionSupported, isDtsExpressSupported, isDtsHdSupported, isDtsSupported, isDtsXSupported, isEmeSupported, isFairPlaySupported, isFairPlayV1Supported, isFairPlayV2Supported, isFairPlayV3Supported, isFlacSupported, isFullHDScreenSupported, isH264BaselineSupported, isH264HighSupported, isH264MainSupported, isHDScreenSupported, isHdrScreenSupported, isHevcMain10Supported, isHevcMainSupported, isMmsSupported, isMp3Supported, isMp4AudioSupported, isMpeg2TSupported, isMpegHAudioSupported, isMseSupported, isNativeHlsSupported, isNativeMpdSupported, isNativeMssSupported, isOpusSupported, isPlayReadySL150Supported, isPlayReadySL2000Supported, isPlayReadySL3000Supported, isPlayReadySupported, isPrimetimeSupported, isSDScreenSupported, isTypeSupported, isVorbisSupported, isVp8Supported, isVp9Supported, isWidevineL1Supported, isWidevineL3Supported, isWidevineSupported }; | ||
export { AAC_CONTENT_TYPE, AV1_CONTENT_TYPE, CLEAR_KEY_SYSTEM, DOLBY_AC3_CONTENT_TYPE, DOLBY_AC4_CONTENT_TYPE, DOLBY_ATMOS_CONTENT_TYPE, DOLBY_EC3_CONTENT_TYPE, DOLBY_VISION_CONTENT_TYPE, DTS_CORE_CONTENT_TYPE, DTS_HD_CORE_PLUS_EXTENSION_CONTENT_TYPE, DTS_HD_LBR_CONTENT_TYPE, DTS_UHD_PROFILE_2_CONTENT_TYPE, DTS_UHD_PROFILE_3_CONTENT_TYPE, FAIRPLAY_KEY_SYSTEM, FAIRPLAY_V1_KEY_SYSTEM, FAIRPLAY_V2_KEY_SYSTEM, FAIRPLAY_V3_KEY_SYSTEM, FLAC_CONTENT_TYPE, H264_BASELINE_CONTENT_TYPE, H264_HIGH_CONTENT_TYPE, H264_MAIN_CONTENT_TYPE, HEV_MAIN10_CONTENT_TYPE, HEV_MAIN_CONTENT_TYPE, HLS_CONTENT_TYPE, HVC_MAIN10_CONTENT_TYPE, HVC_MAIN_CONTENT_TYPE, MP3_CONTENT_TYPE, MP4_AUDIO_CONTENT_TYPE, MPD_CONTENT_TYPE, MPEG2T_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_1_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_1_MULTISTREAM_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_2_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_2_MULTISTREAM_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_CONTENT_TYPE, MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_MULTISTREAM_CONTENT_TYPE, MSS_CONTENT_TYPE, OPUS_CONTENT_TYPE, PLAYREADY_KEY_SYSTEM, PRIMETIME_KEY_SYSTEM, TTML_CONTENT_TYPE, VORBIS_CONTENT_TYPE, VP8_CONTENT_TYPE, VP9_CONTENT_TYPE, WEBVTT_CONTENT_TYPE, WIDEWINE_KEY_SYSTEM, XHE_AAC_CONTENT_TYPE, canPlayType, defaultVideoElement, getDevicePixelRatio, getGpuRenderer, getGpuVendor, getResolutionBadge, getResolutionMode, getScreenDepth, getScreenHeight, getScreenWidth, is10KScreenSupported, is16KScreenSupported, is2KScreenSupported, is2dot5KScreenSupported, is32KScreenSupported, is4KScreenSupported, is5KScreenSupported, is6KScreenSupported, is8KScreenSupported, isAV1Supported, isAacSupported, isClearKeySupported, isContentTypeSupported, isDolbyAtmosSupported, isDolbyDigitalPlusSupported, isDolbyDigitalSupported, isDolbyVisionSupported, isDtsExpressSupported, isDtsHdSupported, isDtsSupported, isDtsXSupported, isEmeSupported, isFairPlaySupported, isFairPlayV1Supported, isFairPlayV2Supported, isFairPlayV3Supported, isFlacSupported, isFullHDScreenSupported, isH264BaselineSupported, isH264HighSupported, isH264MainSupported, isHDScreenSupported, isHdrScreenSupported, isHevcMain10Supported, isHevcMainSupported, isMmsSupported, isMp3Supported, isMp4AudioSupported, isMpeg2TSupported, isMpegHAudioSupported, isMseSupported, isNativeHlsSupported, isNativeMpdSupported, isNativeMssSupported, isOpusSupported, isPlayReadySL150Supported, isPlayReadySL2000Supported, isPlayReadySL3000Supported, isPlayReadySupported, isPrimetimeSupported, isSDScreenSupported, isTypeSupported, isVorbisSupported, isVp8Supported, isVp9Supported, isWidevineL1Supported, isWidevineL3Supported, isWidevineSupported }; |
export declare function isContentTypeSupported(contentType: string): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; |
export declare function isVp8Supported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isVp9Supported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isH264BaselineSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isH264MainSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isH264HighSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isAV1Supported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isHevcMainSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isHevcMain10Supported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isDolbyVisionSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; | ||
export declare function isMpeg2TSupported(): { | ||
file: CanPlayTypeResult; | ||
file: boolean; | ||
mediaSource: boolean; | ||
any: boolean | "maybe" | "probably"; | ||
both: boolean | ""; | ||
any: boolean; | ||
both: boolean; | ||
contentType: string; | ||
}; |
{ | ||
"name": "detect-audio-video", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Detect audio video features", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
35152
871