Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Brightcove Player and videojs integration #395

Merged
merged 6 commits into from
Jul 7, 2016

Conversation

tjaneczko
Copy link

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:

  • Added .idea to the .gitignore file to prevent WebStorm files from being added to git
  • Ensure the version of videojs we're using has the getComponent function before loading the tech
  • Added the vjs-tech class to the tech element div. This is used in several plugins with querySelector to retrieve the tech element div and is needed when used in a Brightcove Player.
  • Added video cueing when switching sources with autoplay disabled.
  • Fixed onPlayerStateChange by setting laststate before triggering any events as some listeners use the state of the player (which is stored in laststate)
  • Added the loadstart event to the loading state (state -1)
  • Added required videojs tech functions autoplay, setAutoplay, loop, seeking, seekable, and preload
  • Return the actual source url and not the source object in currentSrc
  • Don't use native controls on Android browsers that support using HTML controls
  • Fixed conflicts with other plugins (such as IMA) which load YouTube assets by changing the loading of the iframe API. Now, we wait for the API script to be loaded, then we register a callback to the YT.ready function instead of setting a window. onYouTubeIframeAPIReady function. The YT.ready callback function is run once the API is ready to instantiate players and prevents timing issues where the onYouTubeIframeAPIReady 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.

tjaneczko added 5 commits April 1, 2016 10:00
Trigger the 'loadstart' event in states -1 and YT.PlayerState.ENDED to show the poster
Removed extraneous play() in src (since it's called in setSrc anyway)
Added cueing/loading of videos when the source is set
Allow non-native controls on non-stock Android browsers and stock Android 5+ browsers
Removed loadstart trigger when video is ended
Return the url as a string from currentSrc()
* Added the seeking() function to the YouTube tech

* Added more missing tech functions
…e certain videojs plugins (such as IMA) conflict with this
this.options_.autoplay = val;
},

loop: function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does loop not get a setter?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a setLoop function to the tech.

@gkatsev
Copy link
Member

gkatsev commented Jul 7, 2016

LGTM.

@gkatsev gkatsev merged commit 5b6daa5 into videojs:master Jul 7, 2016
@gkatsev gkatsev deleted the bc-fixes branch July 7, 2016 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants