cloudhub-playback-sdk
Version:
CloudHubPlaybackSDK
32 lines (31 loc) • 1.25 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Action_1 = __importDefault(require("./Action"));
const global_1 = __importDefault(require("../global"));
const utils_1 = __importDefault(require("../helper/utils"));
const Logger_1 = __importDefault(require("../Logger"));
class MediaStateChangeAction extends Action_1.default {
constructor(jsonString, room) {
super(jsonString, room);
this.eventType = global_1.default.eventType.mediaStateChange;
Logger_1.default.info(`MediaStateChangeAction`, this);
}
toEventObject() {
const { type, fileid, width, height, duration, userId } = this.attributes;
const { pos: position, pause = undefined } = this.cmd;
const state = { width, height, duration, position, pause };
const mediaType = utils_1.default.getMediaStatus(type);
return {
state,
mediaType,
uid: userId,
options: this.options,
streamId: this.streamId,
cmd: this.cmd,
};
}
}
exports.default = MediaStateChangeAction;