docs(playback): add JSDoc comments for all misisng playback profile

This commit is contained in:
cameron clark 2020-11-28 12:10:41 +00:00 committed by Julien Machiels
parent de788cfc47
commit e6125d6833
9 changed files with 89 additions and 105 deletions

View File

@ -46,7 +46,7 @@ class BrowserDetector {
* @private
* @static
* @param {string} key - Key for which to perform a check.
* @returns {boolean}
* @returns {boolean} Determines if user agent of navigator contains a key
* @memberof BrowserDetector
*/
private userAgentContains(key: string) {
@ -59,7 +59,7 @@ class BrowserDetector {
/**
* Check if the current platform is Mozilla Firefox.
*
* @returns
* @returns {boolean} Determines if browser is Mozilla Firefox
* @memberof BrowserDetector
*/
isFirefox() {
@ -70,7 +70,7 @@ class BrowserDetector {
* Check if the current platform is Microsoft Edge.
*
* @static
* @returns {boolean}
* @returns {boolean} Determines if browser is Microsoft Edge
* @memberof BrowserDetector
*/
isEdge() {
@ -80,7 +80,7 @@ class BrowserDetector {
/**
* Check if the current platform is Google Chrome.
*
* @returns
* @returns {boolean} Determines if browser is Google Chrome
* @memberof BrowserDetector
*/
isChrome() {
@ -97,7 +97,7 @@ class BrowserDetector {
* Returns false for non-Safari browsers on macOS, which are independent of
* Apple.
*
* @returns
* @returns {boolean} Determines if current platform is from Apple
* @memberof BrowserDetector
*/
isApple() {
@ -109,10 +109,10 @@ class BrowserDetector {
/**
* Returns a major version number for Safari, or Safari-based iOS browsers.
*
* @returns
* @returns {number | null} The major version number for Safari
* @memberof BrowserDetector
*/
safariVersion() {
safariVersion(): number | null {
// All iOS browsers and desktop Safari will return true for isApple().
if (!this.isApple()) {
return null;
@ -140,7 +140,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen.
*
* @returns
* @returns {boolean} Determines if current platform is Tizen
* @memberof BrowserDetector
*/
isTizen() {
@ -150,7 +150,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen 2
*
* @returns
* @returns {boolean} Determines if current platform is Tizen 2
* @memberof BrowserDetector
*/
isTizen2() {
@ -160,7 +160,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen 3
*
* @returns
* @returns {boolean} Determines if current platform is Tizen 3
* @memberof BrowserDetector
*/
isTizen3() {
@ -170,7 +170,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen 4.
*
* @returns
* @returns {boolean} Determines if current platform is Tizen 4
* @memberof BrowserDetector
*/
isTizen4() {
@ -180,7 +180,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen 5.
*
* @returns
* @returns {boolean} Determines if current platform is Tizen 5
* @memberof BrowserDetector
*/
isTizen5() {
@ -190,7 +190,7 @@ class BrowserDetector {
/**
* Check if the current platform is Tizen 5.5.
*
* @returns
* @returns {boolean} Determines if current platform is Tizen 5.5
* @memberof BrowserDetector
*/
isTizen55() {
@ -200,14 +200,17 @@ class BrowserDetector {
/**
* Check if the current platform is WebOS.
*
* @returns
* @returns {boolean} Determines if current platform is WebOS
* @memberof BrowserDetector
*/
isWebOS() {
return this.userAgentContains('Web0S');
return this.userAgentContains('WebOS');
}
isWebOS1() {
/**
* @returns {boolean} Determines if current platform is WebOS1
*/
isWebOS1(): boolean {
return (
this.isWebOS &&
this.userAgentContains('AppleWebKit/537') &&
@ -215,7 +218,10 @@ class BrowserDetector {
);
}
isWebOS2() {
/**
* @returns {boolean} Determines if current platform is WebOS1
*/
isWebOS2(): boolean {
return (
this.isWebOS &&
this.userAgentContains('AppleWebKit/538') &&
@ -223,28 +229,40 @@ class BrowserDetector {
);
}
isWebOS3() {
/**
* @returns {boolean} Determines if current platform is WebOS3
*/
isWebOS3(): boolean {
return this.isWebOS && this.userAgentContains('Chrome/38');
}
isWebOS4() {
/**
* @returns {boolean} Determines if current platform is WebOS4
*/
isWebOS4(): boolean {
return this.isWebOS && this.userAgentContains('Chrome/53');
}
isWebOS5() {
/**
* @returns {boolean} Determines if current platform is WebOS5
*/
isWebOS5(): boolean {
return this.isWebOS && this.userAgentContains('Chrome/68');
}
/* Platform Utilities */
isAndroid() {
/**
* @returns {boolean} Determines if current platform is Android
*/
isAndroid(): boolean {
return this.userAgentContains('Android');
}
/**
* Guesses if the platform is a mobile one (iOS or Android).
*
* @returns
* @returns {boolean} Determines if current platform is mobile (Guess)
* @memberof BrowserDetector
*/
isMobile() {
@ -272,10 +290,10 @@ class BrowserDetector {
/**
* Guesses if the platform is a Smart TV (Tizen or WebOS).
*
* @returns
* @returns {boolean} Determines if platform is a Smart TV
* @memberof BrowserDetector
*/
isTv() {
isTv(): boolean {
return this.isTizen() || this.isWebOS();
}
}

View File

@ -1,11 +1,8 @@
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
*
* @param {string} format
* @returns
* @param {string} format Audio codec to test
* @returns {boolean} Determines if audio codec is supported
*/
export function getSupportedAudioCodecs(format: string): boolean {
let typeString;

View File

@ -10,10 +10,10 @@ import {
/**
* Creates a profile condition object for use in device playback profiles.
*
* @param Property
* @param Condition
* @param Value
* @param IsRequired
* @param {ProfileConditionValue} Property
* @param {ProfileConditionType} Condition
* @param {string} Value
* @param {boolean} IsRequired
* @returns {ProfileCondition}
*/
function createProfileCondition(
@ -33,7 +33,7 @@ function createProfileCondition(
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {Array<CodecProfile>}
*/
export function getCodecProfiles(

View File

@ -4,10 +4,8 @@ import { getSupportedAudioCodecs } from './audioFormats';
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if the browser has AC3 in HLS support
*/
function supportsAc3InHls(videoTestElement: HTMLVideoElement) {
if (browserDetector.isTv()) {
@ -31,11 +29,8 @@ function supportsAc3InHls(videoTestElement: HTMLVideoElement) {
}
/**
*
*
* @export
* @param {HTMLVideoElement} videoTestElement
* @returns {string[]}
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} Array of video codecs supported in HLS
*/
export function getHlsVideoCodecs(
videoTestElement: HTMLVideoElement
@ -55,11 +50,8 @@ export function getHlsVideoCodecs(
}
/**
*
*
* @export
* @param {HTMLVideoElement} videoTestElement
* @returns {string[]}
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} Array of audio codecs supported in HLS
*/
export function getHlsAudioCodecs(
videoTestElement: HTMLVideoElement

View File

@ -3,10 +3,8 @@ import { getSupportedAudioCodecs } from './audioFormats';
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if the browser has AC3 support
*/
function hasAc3Support(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTv()) {
@ -21,8 +19,8 @@ function hasAc3Support(videoTestElement: HTMLVideoElement): boolean {
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has EAC3 support
*/
export function hasEac3Support(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTv()) {
@ -37,8 +35,8 @@ export function hasEac3Support(videoTestElement: HTMLVideoElement): boolean {
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has AAC support
*/
export function hasAacSupport(videoTestElement: HTMLVideoElement): boolean {
return !!videoTestElement
@ -47,19 +45,17 @@ export function hasAacSupport(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @returns
* @returns {boolean} Determines if browser has MP2 support
*/
function hasMp2AudioSupport() {
function hasMp2AudioSupport(): boolean {
return browserDetector.isTv();
}
/**
* Function for Determining DTS audio support
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browserr has DTS audio support
*/
function hasDtsSupport(videoTestElement: HTMLVideoElement) {
// DTS audio not supported in 2018 models (Tizen 4.0)
@ -82,9 +78,8 @@ function hasDtsSupport(videoTestElement: HTMLVideoElement) {
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} Array of supported MP4 audio codecs
*/
export function getSupportedMP4AudioCodecs(
videoTestElement: HTMLVideoElement

View File

@ -1,10 +1,8 @@
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has H264 support
*/
export function hasH264Support(videoTestElement: HTMLVideoElement): boolean {
return !!(
@ -16,10 +14,8 @@ export function hasH264Support(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has H265 support
*/
export function hasH265Support(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTv()) {
@ -44,10 +40,8 @@ export function hasH265Support(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has AV1 support
*/
export function hasAv1Support(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTizen && browserDetector.isTizen55()) {
@ -65,10 +59,8 @@ export function hasAv1Support(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has VC1 support
*/
function hasVc1Support(videoTestElement: HTMLVideoElement): boolean {
return !!(
@ -78,10 +70,8 @@ function hasVc1Support(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has VP8 support
*/
export function hasVp8Support(videoTestElement: HTMLVideoElement): boolean {
return !!(
@ -91,10 +81,8 @@ export function hasVp8Support(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if browser has VP9 support
*/
export function hasVp9Support(videoTestElement: HTMLVideoElement): boolean {
return !!(
@ -106,7 +94,7 @@ export function hasVp9Support(videoTestElement: HTMLVideoElement): boolean {
/**
* Queries the platform for the codecs suppers in an MP4 container.
*
* @param videoTestElement
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} Array of codec identifiers.
*/
export function getSupportedMP4VideoCodecs(

View File

@ -1,10 +1,8 @@
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns {boolean}
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if the browser can play native Hls
*/
export function canPlayNativeHls(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTizen()) {
@ -24,10 +22,8 @@ export function canPlayNativeHls(videoTestElement: HTMLVideoElement): boolean {
}
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {boolean} Determines if the browser can play Mkvs
*/
export function hasMkvSupport(videoTestElement: HTMLVideoElement): boolean {
if (browserDetector.isTv()) {

View File

@ -3,8 +3,8 @@ import { hasVp8Support, hasVp9Support, hasAv1Support } from './mp4VideoFormats';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns {string[]}
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} Returns an array of supported codecs
*/
export function getSupportedVPXVideoCodecs(
videoTestElement: HTMLVideoElement

View File

@ -1,10 +1,8 @@
import { browserDetector } from '~/plugins/browserDetection';
/**
*
*
* @param {HTMLVideoElement} videoTestElement
* @returns
* @param {HTMLVideoElement} videoTestElement A HTML video element for testing codecs
* @returns {string[]} An array of supported codecs
*/
export function getSupportedWebMAudioCodecs(
videoTestElement: HTMLVideoElement