[quote=219434:@James Moore]OK thanks Michel,
how would that be expressed be simply expressed xojo, perhaps you might be able to suggest example I could have a look at?[/quote]
Const read_position As String
var vid = document.getElementById("myVideo");
window.location.replace('#'+vid.currentTime+"/"+vid.duration) ;
In a button :
Sub Action()
self.ExecuteJavaScript(ReplaceAll(read_position,"myVideo",MoviePlayer1.ControlID+"_video"))
End Sub
When the code in the button Action event is executed, the JavaScript reads CurrentTime and duration of the HTML5 player, and places that in the HashTag as for instance :
http://127.0.0.1:8080/#18.653902/48.321
Seconds are expressed with a fractional part.
You can get that back in the Session.HashTagChanged event, by reading the Session HashTag property. It is a string, so you can split it with “/” and turn each term into a number. The process is described for the where method at https://forum.xojo.com/26509-serious-issues-with-events-not-firing
Note that because this uses a particular property in the Xojo framework (MoviePlayer1.ControlID+"_video"), that method is not sanctionned by Xojo and not guaranteed to work if at some undetermined point in time in the future Xojo changed the said framework. I know Greg will warn against that, but since Xojo does not give access to this property, that is the only simple option available for now.
The proper alternative would be to implement the HTML Audio video in a WebSDK control, but it goes way beyond the scope of this thread.
Finally, you should know that Xojo Web uses a fallback with Flash for older browsers that cannot support HTML audio and video. In such a case, the code I posted will not work. See http://www.w3schools.com/html/html5_video.asp for the minimum versions required for the most popular browsers. You may want to test Session.Browser and Session.BrowserVersion before you call the method, to avoid errors.