detect-audio-video
Advanced tools
Comparing version 0.38.0 to 0.39.0
@@ -11,3 +11,3 @@ declare global { | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -20,3 +20,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -29,3 +29,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -38,3 +38,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -47,3 +47,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -57,3 +57,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -66,3 +66,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -75,3 +75,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -84,3 +84,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -93,3 +93,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -102,3 +102,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -111,3 +111,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -120,4 +120,4 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
}; |
@@ -15,5 +15,5 @@ export declare const H264_BASELINE_CONTENT_TYPE = "video/mp4; codecs=\"avc1.42E01E\""; | ||
export declare const MPEG2T_CONTENT_TYPE = "video/mp2t"; | ||
export declare const VVC1_MAIN10_CONTENT_TYPE = "vvc1.1.L67.CQA.O0+3"; | ||
export declare const VVCI_MAIN10_CONTENT_TYPE = "vvci.1.L67.CQA.O0+3"; | ||
export declare const EVC_BASELINE_CONTENT_TYPE = "evc1.vprf0.vlev123"; | ||
export declare const EVC_MAIN_CONTENT_TYPE = "evc1.vprf1.vlev153"; | ||
export declare const VVC1_MAIN10_CONTENT_TYPE = "video/mp4; codecs=\"vvc1.1.L67.CQA.O0+3\""; | ||
export declare const VVCI_MAIN10_CONTENT_TYPE = "video/mp4; codecs=\"vvci.1.L67.CQA.O0+3\""; | ||
export declare const EVC_BASELINE_CONTENT_TYPE = "video/mp4; codecs=\"evc1.vprf0.vlev123\""; | ||
export declare const EVC_MAIN_CONTENT_TYPE = "video/mp4; codecs=\"evc1.vprf1.vlev153\""; |
@@ -30,4 +30,5 @@ const AAC_CONTENT_TYPE = 'audio/mp4; codecs="mp4a.40.2"'; | ||
} | ||
function canPlayType(type, mediaElementType = 'video') { | ||
function canPlayType(type) { | ||
let mediaElement; | ||
const mediaElementType = type.split('/')[0]; | ||
if (mediaElementType === 'audio') { | ||
@@ -62,4 +63,4 @@ if (!defaultAudioElement) { | ||
function isContentTypeSupported(contentType, mediaElementType = 'video') { | ||
const canPlayTypeResult = canPlayType(contentType, mediaElementType); | ||
function isContentTypeSupported(contentType) { | ||
const canPlayTypeResult = canPlayType(contentType); | ||
const isTypeSupportedResult = isTypeSupported(contentType); | ||
@@ -71,3 +72,3 @@ return { | ||
both: canPlayTypeResult !== '' && isTypeSupportedResult, | ||
mediaElementType, | ||
mediaElementType: contentType.split('/')[0], | ||
contentType, | ||
@@ -78,15 +79,15 @@ }; | ||
function isMp3Supported() { | ||
return isContentTypeSupported(MP3_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(MP3_CONTENT_TYPE); | ||
} | ||
function isMp4AudioSupported() { | ||
return isContentTypeSupported(MP4_AUDIO_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(MP4_AUDIO_CONTENT_TYPE); | ||
} | ||
function isAacSupported() { | ||
return isContentTypeSupported(AAC_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(AAC_CONTENT_TYPE); | ||
} | ||
function isDolbyDigitalSupported() { | ||
return isContentTypeSupported(DOLBY_AC3_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DOLBY_AC3_CONTENT_TYPE); | ||
} | ||
function isDolbyDigitalPlusSupported() { | ||
return isContentTypeSupported(DOLBY_EC3_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DOLBY_EC3_CONTENT_TYPE); | ||
} | ||
@@ -113,24 +114,24 @@ // audio/mp4; codecs="ec-3"; spatialRendering=true - no support | ||
function isMpegHAudioSupported() { | ||
return isContentTypeSupported(MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(MPEG_H_AUDIO_LC_PROFILE_LEVEL_3_CONTENT_TYPE); | ||
} | ||
function isVorbisSupported() { | ||
return isContentTypeSupported(VORBIS_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(VORBIS_CONTENT_TYPE); | ||
} | ||
function isFlacSupported() { | ||
return isContentTypeSupported(FLAC_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(FLAC_CONTENT_TYPE); | ||
} | ||
function isOpusSupported() { | ||
return isContentTypeSupported(OPUS_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(OPUS_CONTENT_TYPE); | ||
} | ||
function isDtsSupported() { | ||
return isContentTypeSupported(DTS_CORE_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DTS_CORE_CONTENT_TYPE); | ||
} | ||
function isDtsHdSupported() { | ||
return isContentTypeSupported(DTS_HD_CORE_PLUS_EXTENSION_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DTS_HD_CORE_PLUS_EXTENSION_CONTENT_TYPE); | ||
} | ||
function isDtsExpressSupported() { | ||
return isContentTypeSupported(DTS_HD_LBR_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DTS_HD_LBR_CONTENT_TYPE); | ||
} | ||
function isDtsXSupported() { | ||
return isContentTypeSupported(DTS_UHD_PROFILE_2_CONTENT_TYPE, 'audio'); | ||
return isContentTypeSupported(DTS_UHD_PROFILE_2_CONTENT_TYPE); | ||
} | ||
@@ -155,6 +156,6 @@ | ||
const MPEG2T_CONTENT_TYPE = 'video/mp2t'; | ||
const VVC1_MAIN10_CONTENT_TYPE = 'vvc1.1.L67.CQA.O0+3'; | ||
const VVCI_MAIN10_CONTENT_TYPE = 'vvci.1.L67.CQA.O0+3'; | ||
const EVC_BASELINE_CONTENT_TYPE = 'evc1.vprf0.vlev123'; | ||
const EVC_MAIN_CONTENT_TYPE = 'evc1.vprf1.vlev153'; | ||
const VVC1_MAIN10_CONTENT_TYPE = 'video/mp4; codecs="vvc1.1.L67.CQA.O0+3"'; | ||
const VVCI_MAIN10_CONTENT_TYPE = 'video/mp4; codecs="vvci.1.L67.CQA.O0+3"'; | ||
const EVC_BASELINE_CONTENT_TYPE = 'video/mp4; codecs="evc1.vprf0.vlev123"'; | ||
const EVC_MAIN_CONTENT_TYPE = 'video/mp4; codecs="evc1.vprf1.vlev153"'; | ||
@@ -161,0 +162,0 @@ function isVp8Supported() { |
export declare let defaultVideoElement: HTMLVideoElement | undefined; | ||
export declare let defaultAudioElement: HTMLAudioElement | undefined; | ||
export declare function resetDefaultMediaElements(): void; | ||
export declare function canPlayType(type: string, mediaElementType?: 'audio' | 'video'): CanPlayTypeResult; | ||
export declare function canPlayType(type: string): CanPlayTypeResult; |
@@ -1,2 +0,2 @@ | ||
export declare function isContentTypeSupported(contentType: string, mediaElementType?: 'audio' | 'video'): { | ||
export declare function isContentTypeSupported(contentType: string): { | ||
canPlayType: CanPlayTypeResult; | ||
@@ -6,4 +6,4 @@ isTypeSupported: boolean; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
}; |
@@ -6,3 +6,3 @@ export declare function isVp8Supported(): { | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -15,3 +15,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -24,3 +24,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -33,3 +33,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -42,3 +42,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -51,3 +51,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -60,3 +60,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -69,3 +69,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -78,3 +78,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -87,3 +87,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -96,3 +96,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -105,3 +105,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -114,3 +114,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -123,3 +123,3 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
@@ -132,4 +132,4 @@ }; | ||
both: boolean; | ||
mediaElementType: "audio" | "video"; | ||
mediaElementType: string; | ||
contentType: string; | ||
}; |
{ | ||
"name": "detect-audio-video", | ||
"version": "0.38.0", | ||
"version": "0.39.0", | ||
"description": "Detect audio video features", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1175
50948