MRMediaEntity

MRMediaEntity ⇐ MRDivEntity

Base html media entity represented in 3D space. mr-media

Kind: global class
Extends: MRDivEntity

mrMediaEntity.MRMediaEntity

Kind: instance class of MRMediaEntity

new exports.MRMediaEntity()

Constructs a base media entity using a UIPlane and other 3D elements as necessary.

mrMediaEntity.width() ⇒ number

Calculates the width of the MRMedia object

Kind: instance method of MRMediaEntity
Returns: number - - the resolved width

mrMediaEntity.height() ⇒ number

Calculates the height of the MRMedia object

Kind: instance method of MRMediaEntity
Returns: number - - the resolved height

mrMediaEntity.mediaWidth() ⇒ number

Calculates the width of the media based on the media tag itself This function will error if called directly as an MRMedia item. Made to be overridden by children.

Kind: instance method of MRMediaEntity
Returns: number - - the resolved height

mrMediaEntity.mediaHeight() ⇒ number

Calculates the height of the media based on the media tag itself This function will error if called directly as an MRMedia item. Made to be overridden by children.

Kind: instance method of MRMediaEntity
Returns: number - - the resolved height

mrMediaEntity.generateNewMediaPlaneGeometry()

Creates the Media Plane Geometry used to draw the Image,Video,etc This is a separate object to allow for common css styling such as ‘contain’ and ‘scale-down’.

Kind: instance method of MRMediaEntity

mrMediaEntity.loadMediaTexture()

Loads the associated media into 3D based on its html properties. This function will error if called directly as an MRMedia item. Made to be overridden by children.

Kind: instance method of MRMediaEntity

mrMediaEntity.connected()

(async) handles setting up this media and associated 3D geometry style (from css) once it is connected to run as an entity component.

Kind: instance method of MRMediaEntity

mrMediaEntity.mutated(mutation)

Callback function of MREntity - Updates the media’s cover,fill,etc based on the mutation request.

Kind: instance method of MRMediaEntity

Param Type Description
mutation object the update/change/mutation to be handled.

mrMediaEntity.computeObjectFitDimensions()

computes the width and height values for the image considering the value of object-fit

Kind: instance method of MRMediaEntity