- From: Ingar Arntzen via GitHub <sysbot+gh@w3.org>
- Date: Thu, 06 Aug 2015 13:07:08 +0000
- To: public-webtiming@w3.org
The difference as I have understood it is that the paused flag can be
trusted to represent the true state of the media player, whereas the
playbackRate is a specification of default playback velocity, a value
which will survive pause/resume toggling. If this is correct then I
think the timing object API can easily be extended to support this (by
the programmer on demand).
For example, something like this should work?
```js
var defaultPlaybackRate = 1.0;
to.__defineGetter__("playbackRate", function () {return
defaultPlaybackRate;});
to.__defineSetter__("playbackRate", function (value)
{defaultPlaybackRate = value;})
to.__defineGetter__("paused", function () {
var vector = to.query();
return (vector.velocity === 0.0 && vector.acceleration ===
0.0);
});
to.__defineSetter__("paused", function (value) {
// pause
if (value) to.update(null, 0.0, 0.0);
// resume
else to.update(null, to.playbackRate, null);
});
```
--
GitHub Notif of comment by ingararntzen
See
https://github.com/webtiming/timingobject/issues/14#issuecomment-128356322
Received on Thursday, 6 August 2015 13:07:12 UTC