Hi,
I want to include a video in a tiddler with the video html tag (the video
is a local file).
And I want to change the currentTime attribute of the video element so that
the video starts at a precise time.
But I don't want to use the start time (or end time) that one can put at
the end of the src attribute (at least in Firefox), because I want to be
able to go to a previous time if I need some context. And specifying a
start time doesn't allow that.
So I created a js macro to do the job and I'm pretty sure it's not the
right way to go because macros should'nt have side-effects. But it works !
Here is the macro :
/*\
title: gotoTime.js
type: application/javascript
module-type: macro
<<gotoTime id time>>
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Information about this macro
*/
exports.name = "gotoTime";
exports.params = [
{ name: "id" },
{ name: "time" }
];
/*
Run the macro
*/
exports.run = function(id, time) {
var myVid = document.getElementById(id);
myVid.addEventListener("canplay",function() { myVid.currentTime =
parseInt(time);});
return "";
};
})();
In my test tiddler :
<video id="demo" width=100% controls="controls">
<source src= "./DVDs/Forme103/00Enchainement.mp4"/>
</video>
<<gotoTime demo 100>>
So my problem is that I'd like to make it the right way (or the TW5ish way
!).
Could someone give me some guidelines ?
Thanks
FrD
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/a304f8b6-97e8-482b-95ea-cb2d0172c2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.