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

Some docs and usage examle #4

Open
BeOleg opened this issue Dec 16, 2013 · 4 comments
Open

Some docs and usage examle #4

BeOleg opened this issue Dec 16, 2013 · 4 comments

Comments

@BeOleg
Copy link

BeOleg commented Dec 16, 2013

I browser you code, and it seems to me that your service produces an instance of a video using the YouTube JS api statically.
Which is basically the same is using an embed flash player.
And won't allow users to add their own video for instance.

Instead of creating the video instance at the link function of the directive, perhaps it could be nice to pass it as a 2-way-bind attribute.

I can implement something like this and open a PR, if you are interested.

Also, regardless of the usage example for the existing code could be great, thanks 👍

@brandly
Copy link

brandly commented Mar 13, 2014

I made a fork that does a nice two-way binding and has usage examples.

@landed1
Copy link

landed1 commented Mar 13, 2014

The API YT player is quite similar to the embeded one but this one does have a control to stop and play the video and more. I didn't manage to get the embedable player to do the same. However I had issues with getting this player to initialise quick enough for me. So I am using the much simpler embeded player and setting the video to a fake video id does indeed stop the video from playing !

@brandly
Copy link

brandly commented Mar 15, 2014

@landed1 I added some documentation about controlling the player: https://github.com/brandly/angular-youtube#events-and-player-controls

You could stop the player from within a controller.

myApp.controller('MyCtrl', function ($scope, $youtube) {
  $scope.stopPlayer = function () {
    $youtube.player.stopVideo();
  };
});

@arnaudbreton I've made quite a few changes already, and I'm considering more. If you'd like me to open a pull request for any or all of these changes, I'd be happy to! Otherwise, I might break off into my own repo, since I can't file issues or anything on a forked repo. 🍴

@arnaudbreton
Copy link
Owner

@brandly Yes I would be happy to review and merge your PR in the main repo! Feel free to submit them. Thanks for your contribution.

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

No branches or pull requests

4 participants