Thursday 15 July 2010

html5 - Video make POST or GET -


I am trying to make some videos, when some time people inside the video will call the audience.

So, I have a video that I need to trigger an event, a post or a GET.

What's the better way to do this? Maybe some html5 code, I do not know the best ideas.

If you are using HTML5 video, Code> timeupdate event.

  & lt; Div id = "stage" & gt; & Lt; Video src = "http://example.com/myvideo.webm" control id = myvideo & gt; & Lt; / Video & gt; & Lt; / Div & gt; & Lt; Script & gt; Var TimeOffEvent = 30; // event time in seconds (function () {var v = document.getElementById ('myvideo'); v.addEventListener ('timeupdate', function) {if (v.currentTime> date = timeOfEvent) {/ / Do your action here // You will need to make sure that your action only takes a fire.}}, False);}); & Lt; / Script & gt;   

Note: Current time is not an integer, and the time between scheduling changes Trying to do something at a precise point in the video will almost certainly not work for you currentTime (i.e. whole seconds) or for any category (like currentTime & Can test for the integer part of gt; 10 || present time & lt; 20 ), but both of these probably will be easier than once Krin it does not matter for the update, but should be done only once for the action that you avoid performing any kind it many times that require tracking.

No comments:

Post a Comment