var gdjs;(function(o){class i extends o.RuntimeObject{constructor(e,t){super(e,t);this._pausedAsScenePaused=!1;this._opacity=t.content.opacity,this._loop=t.content.loop,this._volume=t.content.volume,this._videoResource=t.content.videoResource,this._renderer=new o.VideoRuntimeObjectRenderer(this,e),this.onCreated()}getRendererObject(){return this._renderer.getRendererObject()}updateFromObjectData(e,t){return e.content.opacity!==t.content.opacity&&this.setOpacity(t.content.opacity),e.content.loop!==t.content.loop&&this.setLoop(t.content.loop),e.content.volume!==t.content.volume&&this.setVolume(t.content.volume),e.content.videoResource===t.content.videoResource}extraInitializationFromInitialInstance(e){e.customSize&&(this.setWidth(e.width),this.setHeight(e.height))}onDestroyFromScene(e){super.onDestroyFromScene(e),this._renderer.onDestroy()}update(e){this._renderer.ensureUpToDate()}setX(e){super.setX(e),this._renderer.updatePosition()}setY(e){super.setY(e),this._renderer.updatePosition()}setAngle(e){super.setAngle(e),this._renderer.updateAngle()}setOpacity(e){this._opacity=e,this._renderer.updateOpacity()}getOpacity(){return this._opacity}setWidth(e){this._renderer.getWidth()!==e&&(this._renderer.setWidth(e),this.invalidateHitboxes())}setHeight(e){this._renderer.getHeight()!==e&&(this._renderer.setHeight(e),this.invalidateHitboxes())}getWidth(){return this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}play(){this._renderer.play()}pause(){this._renderer.pause()}setLoop(e){this._renderer.setLoop(e)}mute(e){this._renderer.setMute(e)}isMuted(){return this._renderer.isMuted()}setVolume(e){this._volume=o.evtTools.common.clamp(o.evtTools.common.normalize(e,0,100),0,1)*100,this._renderer.updateVolume()}getVolume(){return o.evtTools.common.normalize(this._renderer.getVolume(),0,1)*100}isPlayed(){return this._renderer.isPlayed()}isPaused(){return!this._renderer.isPlayed()}isLooped(){return this._renderer.isLooped()}getDuration(){return this._renderer.getDuration()}isEnded(){return this._renderer.isEnded()}setCurrentTime(e){this._renderer.setCurrentTime(e)}getCurrentTime(){return this._renderer.getCurrentTime()}setPlaybackSpeed(e){this._playbackSpeed=o.evtTools.common.clamp(e,.5,2),this._renderer.setPlaybackSpeed(this._playbackSpeed)}getPlaybackSpeed(){return this._renderer.getPlaybackSpeed()}}o.VideoRuntimeObject=i,o.registerObject("Video::VideoObject",o.VideoRuntimeObject),o.registerRuntimeSceneUnloadedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n.isPlayed()&&n.pause()}}),o.registerRuntimeScenePausedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n.isPlayed()&&(n.pause(),n._pausedAsScenePaused=!0)}}),o.registerRuntimeSceneResumedCallback(function(r){const e=r.getAdhocListOfAllInstances();for(let t=0;t<e.length;++t){const n=e[t];n instanceof o.VideoRuntimeObject&&n._pausedAsScenePaused&&n.play()}})})(gdjs||(gdjs={}));
//# sourceMappingURL=videoruntimeobject.js.map
