2018-05-06 17:18:37 +02:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
|
2018-05-06 19:57:07 +02:00
|
|
|
var size = R3.Utils.GetWindowSize();
|
|
|
|
|
2018-05-06 17:18:37 +02:00
|
|
|
if (R3.Utils.UndefinedOrNull(width)) {
|
2018-05-06 19:57:07 +02:00
|
|
|
width = size.width;
|
2018-05-06 17:18:37 +02:00
|
|
|
}
|
|
|
|
this.width = width;
|
|
|
|
|
|
|
|
if (R3.Utils.UndefinedOrNull(height)) {
|
2018-05-06 19:57:07 +02:00
|
|
|
height = size.height;
|
2018-05-06 17:18:37 +02:00
|
|
|
}
|
|
|
|
this.height = height;
|
|
|
|
|
|
|
|
if (R3.Utils.UndefinedOrNull(offset)) {
|
|
|
|
offset = new R3.API.Vector2(0,0);
|
|
|
|
}
|
|
|
|
this.offset = offset;
|
|
|
|
|
|
|
|
if (R3.Utils.UndefinedOrNull(source)) {
|
2018-05-06 19:57:07 +02:00
|
|
|
source = null;
|
2018-05-06 17:18:37 +02:00
|
|
|
}
|
|
|
|
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;
|