function hasVideoFormat(codec) {
	let result = false;
	if (hasVideo === true) {
		if (typeof videoCodecs === "undefined") {
			// check for support
			const videoElement = globalThis.document.createElement("video");
			videoCodecs = {
				h264: videoElement
					.canPlayType('video/mp4; codecs="avc1.42E01E"')
					.replace(/^no$/, ""),
				h265: videoElement
					.canPlayType('video/mp4; codecs="hev1"')
					.replace(/^no$/, ""),
				ogg: videoElement
					.canPlayType('video/ogg; codecs="theora"')
					.replace(/^no$/, ""),
				mp4: videoElement
					.canPlayType('video/mp4; codecs="avc1.42E01E"')
					.replace(/^no$/, ""),
				m4v: videoElement.canPlayType("video/x-m4v").replace(/^no$/, ""),
				webm: videoElement
					.canPlayType('video/webm; codecs="vp8, vorbis"')
					.replace(/^no$/, ""),
				vp9: videoElement
					.canPlayType('video/webm; codecs="vp9"')
					.replace(/^no$/, ""),
				hls: videoElement
					.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"')
					.replace(/^no$/, ""),
			};
		}
		result = !!videoCodecs[codec];
	}
	return result;
}
detect if the given video format is supported
@memberof device
@param {"h264"|"h265"|"ogg"|"mp4"|"m4v"|"webm"|"vp9"|"hls"} codec - the video format to check for support
@returns {boolean} return true if the given video format is supported