|
|
|
@ -2438,7 +2438,7 @@ export class Log { |
|
|
|
|
*/ |
|
|
|
|
export class MediaInformation { |
|
|
|
|
|
|
|
|
|
static KEY_MEDIA_PROPERTIES = "format"; |
|
|
|
|
static KEY_FORMAT_PROPERTIES = "format"; |
|
|
|
|
static KEY_FILENAME = "filename"; |
|
|
|
|
static KEY_FORMAT = "format_name"; |
|
|
|
|
static KEY_FORMAT_LONG = "format_long_name"; |
|
|
|
@ -2460,7 +2460,7 @@ export class MediaInformation { |
|
|
|
|
* @return media file name |
|
|
|
|
*/ |
|
|
|
|
getFilename() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_FILENAME); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FILENAME); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2469,7 +2469,7 @@ export class MediaInformation { |
|
|
|
|
* @return media format |
|
|
|
|
*/ |
|
|
|
|
getFormat() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_FORMAT); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FORMAT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2478,7 +2478,7 @@ export class MediaInformation { |
|
|
|
|
* @return media long format |
|
|
|
|
*/ |
|
|
|
|
getLongFormat() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_FORMAT_LONG); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FORMAT_LONG); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2487,7 +2487,7 @@ export class MediaInformation { |
|
|
|
|
* @return media duration in "seconds.microseconds" format |
|
|
|
|
*/ |
|
|
|
|
getDuration() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_DURATION); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_DURATION); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2496,7 +2496,7 @@ export class MediaInformation { |
|
|
|
|
* @return media start time in milliseconds |
|
|
|
|
*/ |
|
|
|
|
getStartTime() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_START_TIME); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_START_TIME); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2505,7 +2505,7 @@ export class MediaInformation { |
|
|
|
|
* @return media size in bytes |
|
|
|
|
*/ |
|
|
|
|
getSize() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_SIZE); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_SIZE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2514,7 +2514,7 @@ export class MediaInformation { |
|
|
|
|
* @return media bitrate in kb/s |
|
|
|
|
*/ |
|
|
|
|
getBitrate() { |
|
|
|
|
return this.getStringProperty(MediaInformation.KEY_BIT_RATE); |
|
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_BIT_RATE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2523,7 +2523,7 @@ export class MediaInformation { |
|
|
|
|
* @return tags dictionary |
|
|
|
|
*/ |
|
|
|
|
getTags() { |
|
|
|
|
return this.getProperties(MediaInformation.KEY_TAGS); |
|
|
|
|
return this.getFormatProperty(MediaInformation.KEY_TAGS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2571,58 +2571,103 @@ export class MediaInformation { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the media property associated with the key. |
|
|
|
|
* Returns the property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key property key |
|
|
|
|
* @return media property as string or undefined if the key is not found |
|
|
|
|
* @return property as string or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getStringProperty(key) { |
|
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
|
return mediaProperties[key]; |
|
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
|
if (allProperties !== undefined) { |
|
|
|
|
return allProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the media property associated with the key. |
|
|
|
|
* Returns the property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key property key |
|
|
|
|
* @return media property as number or undefined if the key is not found |
|
|
|
|
* @return property as number or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getNumberProperty(key) { |
|
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
|
return mediaProperties[key]; |
|
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
|
if (allProperties !== undefined) { |
|
|
|
|
return allProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the media properties associated with the key. |
|
|
|
|
* Returns the property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key properties key |
|
|
|
|
* @return media properties as an object or undefined if the key is not found |
|
|
|
|
* @param key property key |
|
|
|
|
* @return property as an object or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getProperties(key) { |
|
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
|
return mediaProperties[key]; |
|
|
|
|
getProperty(key) { |
|
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
|
if (allProperties !== undefined) { |
|
|
|
|
return allProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the format property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key property key |
|
|
|
|
* @return format property as string or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getStringFormatProperty(key) { |
|
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
|
if (formatProperties !== undefined) { |
|
|
|
|
return formatProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the format property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key property key |
|
|
|
|
* @return format property as number or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getNumberFormatProperty(key) { |
|
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
|
if (formatProperties !== undefined) { |
|
|
|
|
return formatProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the format property associated with the key. |
|
|
|
|
* |
|
|
|
|
* @param key property key |
|
|
|
|
* @return format property as an object or undefined if the key is not found |
|
|
|
|
*/ |
|
|
|
|
getFormatProperty(key) { |
|
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
|
if (formatProperties !== undefined) { |
|
|
|
|
return formatProperties[key]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns all media properties. |
|
|
|
|
* Returns all format properties defined. |
|
|
|
|
* |
|
|
|
|
* @returns an object where media properties can be accessed by property names |
|
|
|
|
* @returns an object where format properties can be accessed by property names |
|
|
|
|
*/ |
|
|
|
|
getMediaProperties() { |
|
|
|
|
getFormatProperties() { |
|
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
|
return this.#allProperties.format; |
|
|
|
|
return this.#allProperties[MediaInformation.KEY_FORMAT_PROPERTIES]; |
|
|
|
|
} else { |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|