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.
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
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.
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.