-
Notifications
You must be signed in to change notification settings - Fork 792
Conversation
import { Hls } from '../src/videojs-contrib-hls'; | ||
|
||
let when = function(element, type, cb, condition) { | ||
element.on(type, function func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use element.one
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want the function to fire when the targeted event is triggered and a certain condition is met. Using one
will just remove it the first time the event is fired.
For example, I use this with timeupdate
and some target time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, totally missed that. I guess I was focused on less code :P
player.autoplay(true); | ||
|
||
playFor(player, 2, function() { | ||
QUnit.ok(true, 'played for three more seconds'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be "played for three two more seconds" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I get for copy/paste
Fixed MSE and environment test helpers, restore properly Removed unused test files
39e65cc
to
5b68a88
Compare
|
||
video.width = 600; | ||
video.height = 300; | ||
document.querySelector('#qunit-fixture').appendChild(video); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not an issue but do we want to remove the element from the DOM between tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qunit will automatically reset the fixture it provides https://qunitjs.com/cookbook/#keeping-tests-atomic
|
||
QUnit.module('Playback', { | ||
beforeEach() { | ||
QUnit.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use async and done instead of stop and start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update Qunit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/apsdehal/qunit-migrate might be useful for the other projects that are going to update qunit.
Never mind, this doesn't really work well with ES6
LGTM |
Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Fixed a small bug in gap-skipper where we could seek to the same spot during a video underflow more than once Provide option to set contrib-hls first in the HTML5 tech (#889) Add playback tests (#894) remove expired time tracking and use sync points to calculate seekable (#898)
* Added playback test Fixed MSE and environment test helpers, restore properly Removed unused test files * Update to qunit 2.0
Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
This is the start to automating end to end playback tests.