Skip to content

Commit 8a9e0c2

Browse files
committed
Added currentTime and duration getters.
1 parent afb1628 commit 8a9e0c2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/gameobjects/Video.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,34 @@ Phaser.Video.prototype = {
201201

202202
};
203203

204+
/**
205+
* @memberof Phaser.Video
206+
* @property {number} currentTime - The current time of the video in seconds.
207+
* @readOnly
208+
*/
209+
Object.defineProperty(Phaser.Video.prototype, "currentTime", {
210+
211+
get: function () {
212+
213+
return this.video.currentTime;
214+
215+
}
216+
217+
});
218+
219+
/**
220+
* @memberof Phaser.Video
221+
* @property {number} duration - The duration of the video in seconds.
222+
* @readOnly
223+
*/
224+
Object.defineProperty(Phaser.Video.prototype, "duration", {
225+
226+
get: function () {
227+
228+
return this.video.duration;
229+
230+
}
231+
232+
});
233+
204234
Phaser.Video.prototype.constructor = Phaser.Video;

0 commit comments

Comments
 (0)