Class: MediaFile

@bldr/vue-plugin-media.MediaFile

Hold various data of a media file as class properties.

If a media file has a property with the name multiPartCount set, it is a multi part asset. A multi part asset can be restricted to one part only by a URI fragment (for example #2). The URI id:Score#2 resolves always to the HTTP URL http:/example/media/Score_no02.png.

new module:@bldr/vue-plugin-media.MediaFile (mediaData)

Name Type Description
mediaData object

A mandatory property is: uri

Properties:
Name Type Description
uri string

Uniform Resource Identifier, for example id:Haydn, filename:Haydn_Joseph.jpg or http://example.com/Haydn_Joseph.jpg.

uriScheme string

for example: http, https, blob

uriAuthority string

for example: //example.com/Haydn_Joseph.jpg.

httpUrl string

HTTP Uniform Resource Locator, for example http://example.com/Haydn_Joseph.jpg.

path string

The relative path on the HTTP server, for example composer/Haydn_Joseph.jpg.

filename string

The file name, for example Haydn_Joseph.jpg.

extension string

The file extension, for example jpg.

id string

An identifier, for example Haydn_Joseph.

type string

The media type, for example image, audio or video.

previewHttpUrl string

Each media file can have a preview image. On the path is _preview.jpg appended.

shortcut string

The keyboard shortcut to play the media.

samples Object

An object of Sample instances.

multiPartCount Number

The of count of parts if the media file is a multi part asset.

cover String

An media URI of a image to use a preview image for mainly audio files. Video files are also supported.

Members

isPlayable Boolean

True if the media file is playable, for example an audio or a video file.

isVisible Boolean

True if the media file is visible, for example an image or a video file.

mediaElement object

The HTMLMediaElement of the media file.

plainText string

All plain text collected from the properties except some special properties.

propertiesSorted

Sort properties alphabetically aand move some important ones to the begining of the array.

The vue router link of the component MediaFile.vue.

Examples:

  • #/media/localfile/013b3960-af60-4184-9d87-7c3e723550b8

shortcut string

The keyboard shortcut to play the media

titleSafe String

type string

The media type, for example image, audio or video.

uri string

Uniform Resource Identifier, for example id:Haydn, filename:Haydn_Joseph.jpg or http://example.com/Haydn_Joseph.jpg. The sample addition (#complete) is removed.

uriAuthority string

for example: //example.com/Haydn_Joseph.jpg.

uriRaw String

The raw URI unformatted, possible with a fragment (#2) to restrict multi part assets.

uriScheme string

for example: http, https, blob

Methods

addProperties (properties)

Merge an object into the class object.

Name Type Description
properties object

Add an object to the class properties.

extensionFromString (string)

Extract the extension from a string.

Name Type Description
string String

filenameFromHTTPUrl (url)

Store the file name from a HTTP URL.

Name Type Description
url String

getMultiPartHttpUrlByNo ()String

Dummy method. Has to be overwritten by the subclass MultiPartAsset(). Returns this.httpUrl.

Returns:
Type Description
String