67 lines
1.3 KiB
JavaScript
67 lines
1.3 KiB
JavaScript
|
/**
|
||
|
* R3.API.Video
|
||
|
* @param id
|
||
|
* @param name
|
||
|
* @param parentEntity
|
||
|
* @param autoUpdateSize
|
||
|
* @param width
|
||
|
* @param height
|
||
|
* @param offset
|
||
|
* @param source
|
||
|
* @constructor
|
||
|
*/
|
||
|
R3.API.Video = function(
|
||
|
id,
|
||
|
name,
|
||
|
parentEntity,
|
||
|
autoUpdateSize,
|
||
|
width,
|
||
|
height,
|
||
|
offset,
|
||
|
source
|
||
|
) {
|
||
|
if (R3.Utils.UndefinedOrNull(id)) {
|
||
|
id = R3.Utils.RandomId();
|
||
|
}
|
||
|
this.id = id;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(name)) {
|
||
|
name = 'Video (' + id + ')';
|
||
|
}
|
||
|
this.name = name;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(autoUpdateSize)) {
|
||
|
autoUpdateSize = true;
|
||
|
}
|
||
|
this.autoUpdateSize = autoUpdateSize;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(width)) {
|
||
|
width = 320;
|
||
|
}
|
||
|
this.width = width;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(height)) {
|
||
|
height = 240;
|
||
|
}
|
||
|
this.height = height;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(offset)) {
|
||
|
offset = new R3.API.Vector2(0,0);
|
||
|
}
|
||
|
this.offset = offset;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(source)) {
|
||
|
source = "Data/output_4.ogg";
|
||
|
}
|
||
|
this.source = source;
|
||
|
|
||
|
R3.API.Component.call(
|
||
|
this,
|
||
|
R3.Component.VIDEO,
|
||
|
parentEntity
|
||
|
);
|
||
|
};
|
||
|
|
||
|
R3.API.Video.prototype = Object.create(R3.API.Component.prototype);
|
||
|
R3.API.Video.prototype.constructor = R3.API.Video;
|