Fixes for Brightcove Player and videojs integration #395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A number of fixes were made to the YouTube tech to allow it to be used in the Brightcove Player. Most of these fixes also fix issues which could come up using a videojs player with certain plugins. Here's a list of everything that was changed:
.gitignore
file to prevent WebStorm files from being added to gitgetComponent
function before loading the techvjs-tech
class to the tech element div. This is used in several plugins withquerySelector
to retrieve the tech element div and is needed when used in a Brightcove Player.onPlayerStateChange
by settinglaststate
before triggering any events as some listeners use the state of the player (which is stored inlaststate
)loadstart
event to the loading state (state -1)autoplay
,setAutoplay
,loop
,seeking
,seekable
, andpreload
currentSrc
YT.ready
function instead of setting awindow. onYouTubeIframeAPIReady
function. TheYT.ready
callback function is run once the API is ready to instantiate players and prevents timing issues where theonYouTubeIframeAPIReady
function could potentially be overwritten by other code.Feel free to leave any comments or ask any questions about any of the changes / fixes. I am going to be away on vacation for the next week, but should hopefully be able to get around to responding to them during that time.