mozilla / popcorn-js

The HTML5 Media Framework. (Unmaintained. See https://github.com/menismu/popcorn-js for activity)
MIT License
2.14k stars 632 forks source link

playbackRate() now works with null player #363

Open aphid opened 10 years ago

aphid commented 10 years ago

I have some test code @ http://aphid.org/funwithnull where it halves playbackRate and restarts every 9 seconds. This will be awesome for rashomon :dancers:

mjschranz commented 10 years ago

Can we also get some tests here for this addition? You mentioned you have some code using this patch already so if there was an easy way to write a reduced test case for this that would be great.

ScottDowne commented 10 years ago

I agree some automated unit tests would be ideal, but, it can be annoying writting tests for the first time, so I'm willing to help with that in any way.

Also, very cool because I think this also works in reverse if you set the playbackRate to -1.5. Just a cool little feature.

aphid commented 10 years ago

I wrote a test which may not be ideal: it passes if it receives a negative playbackRate and the playhead moves backward. This seemed a lot easier than doing complicated timing tests against forward play.

ScottDowne commented 10 years ago

In general the whitespace should be bracket space variable ( "#video" ) vs bracket variable ("#video")

ScottDowne commented 10 years ago

I couldn't find a ticket for this in Bugzilla, but, probably should have one before we land.

I filed it here https://bugzilla.mozilla.org/show_bug.cgi?id=950393

And put it into review on myself.