patchCanPlayType is called on load.
It patched video#canPlayType if needed.
unpatchCanPlayType will revert the patch and return the patch function.
There are also corresponding tests that test patchCanPlayType,
unpatchCanPlayType and also whether the patch functions themselves work
correctly.
It can be handy that src() returns the player object when it is invoked but it does not match the behavior of the corresponding property on the video element. Ignoring the spec however, while the video element is running the resource selection algorithm, currentSrc may be undefined. If the video source has been specified through an attribute on the video element, src() is the natural way to expose that URL programmatically. Without this change, it's necessary to bypass the player and interact with the tech directly to determine the value of the src attribute.
TOUCH_ENABLED is false on non-touch devices which causes our minified API test to fail when opened in a browser on a traditional destktop machine. It worked fine through the command line because apparanetly phantomjs supports touch events (ha!). Check to make sure the property is not undefined instead.
Instead of caching the last seek time at the player level, cache it in the Flash tech. The only place this value was used was in the progress controls when Flash was loaded, so this simplifies the logic in that component and pushes the hack down into a single location at least.
Use string literals to lookup fullscreen-related methods on the player object in the fullscreenToggle component. Otherwise, closure compiler replaces them with minified method names and makes it impossible to supply a simpler "player" object with customized fullscreen logic for the fullscreenToggle to interact with.
When poster() is called with a URL, fire a `posterchange` event to update the PosterImage source and update the video element attribute.
Trigger posterchange after updating the tech
Wait until the tech has updated its poster image before alerting components so they don't see the intermediate state in event handlers. Remove unused variable from PosterImage.createEl.
Don't create new img elements each time the poster is set on ie8
Create the img fallback for the poster during PosterImage initialization on ie8 so we can avoid having to check and possibly create it each time the src is set. Add a test to ensure that new elements are not appended to the poster component when the img fallback is in use and the src attribute is modified.
fixing a broken IE8 test, and adding a negative test, for poster switching.
modified the poster-switching test to accomodate IE8
added a negative test for an undefined poster
fixed the assertion message in the 'undefined' image case
fixed test breakage in Firefox and IE10 (quotes were not being handled properly in the test data)
testing:
ran the tests at the command line, and in Chrome, Firefox, IE8, IE10, Firefox and Safari
all passed
Chrome 29 on OS X (at least) seems to report fractional dimensions occasionally when integer values are assigned. For example, '123px' might be translated to '123.999998458px'. Parse the value and round it to ignore this slight discrepancy.
This allows you to define a different element to append children to as opposed to the main component element. Because sometimes components require more than one element to create their structure. e.g. a menu button.
I've got a way to run tests across every browser and device out there except for IE8, and IE8 should work except I'm running into a Browserstack bug that I've let them know about.
It uses a project called bunyip, which internallt uses Yeti (YUI), Pagekite, and Browserstack.
Next steps include:
- Making it all automatic. Right now you have to wait for browsers to connect and then manually hit enter when they have.
- Make it a grunt task
- Document it all so others can use it
I think this is close enough for me to close the milestone 4.0 issue.
When transferring the poster attribute from the container to the tech in mediafaker, use the accessor methods instead of directly referencing the private properties.
We use a div with a background image to simulate the poster image so that we can use a single poster implementation for flash and html. It may be desirable on some platforms to use the native poster image, however. On iPhones for instance, the simulated poster image covers up the native play button and can make it difficult to figure out where to touch to initiate playback. By keeping the poster attribute on the underlying video element, you can hide the simulated poster to get a native look-and-feel on that platform.
Disabled is a bit overloaded with visible but unusable controls, so use hidden instead. Re-arrange default styles a bit and use dom helper methods instead of the vjs-objection functions.
If you are quick, you could get videojs to wrap the HTML video element twice on iOS. The video element has to be recreated after moving on iOS but we weren't re-associating it with the player object. When autoSetup swung through, it would re-initialize the video element and create a player within a player.
The volume controls and mute toggle are guarding against not having a tech present, so it's no longer necessary to mock the tech for all command-line tests. Individual tests continue to do so using PlayerTest.makePlayer.
Hide volume slider and mute toggle when the current tech doesn't support adjusting video volume. Added controls specific test cases. Volume-related controls retest whether to display themselves whenever `loadstart` fires.