Skip to content

Commit

Permalink
implement HTMLMediaElement.CurrentTime
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed Jan 12, 2025
1 parent 33f2615 commit d28842f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Wasm.Dom/Dom/HTMLMediaElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ public string CurrentSrc
get { return InvokeRet<string>("nkMedia.GetCurrentSrc"); }
}

public TimeSpan CurrentTime
{
get
{
int currentTime = InvokeRet<int>("nkMedia.GetCurrentTime");
return TimeSpan.FromMilliseconds(currentTime);
}
}

public string Src
{
get { return InvokeRet<string>("nkMedia.GetSrc"); }
Expand Down
6 changes: 6 additions & 0 deletions Wasm.Dom/wwwroot/js/Media.8.0.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
var me = nkJSObject.GetObject(uid);
return BINDING.js_to_mono_obj(me.currentSrc);
},

GetCurrentTime: function (uid)
{
var me = nkJSObject.GetObject(uid);
return me.currentTime * 1000;
},

GetEnded: function (uid, d)
{
Expand Down

0 comments on commit d28842f

Please sign in to comment.