Comments (5)
mmh you're quite right, it might come up handy.
I think that angular does compile the directive AFTER the link
function so i am in a bit of trouble finding the right place to call for $rootScope.$emit
from angular-media-player.
I lied, it wasn't hard after all!
How to use it:
angular.module('docs')
.controller('InteractiveController', function ($scope, top100SongsEver, $log) {
$scope.$on('audioplayer:ready', function (evt, instance) {
debugger;
// Here you can use 'instance' as the created audioPlayer
instance.load();
});
});
Keep note that the default name is 'audioplayer' 😱 (such creativity!), so the event for the 99% of users will be called audioplayer:ready
About releasing this feature: i need to make a minor release, and i will do it as soon as i have more time, you can build it quite easily with grunt build
in meantime
@aw-emberex tell me if that is what you were after
from angular-media-player.
As @aw-emberex reported:
When this event is fired, the exposed player on my containing scope is still not set ("$scope.audio1") per the example. Is this something the plugin can remedy or is it a angular thing/issue?
This is true.
I googled the best i could to find informations about how angular.js isolated scopes and their two-way databinding work, it is still unclear to me when and how the databinding gets done.
I can suppose it happens after the linking function is done executing, so probably using:
$timeout(function () {
$log.debug($scope.audio1);
});
Would find your $scope
populated
This is the best link i could find.
To have a better idea i've to dive into the code, something i will do, but.. really... when i have time for that ;)
from angular-media-player.
Is the ability to set a name in the main branch yet?
I still have a forked version I'm using so I can have properly namespaced audio players. I have several on a page.
from angular-media-player.
Name is not useful anymore since events will not be sent to $rootScope
.
Check out https://github.com/mrgamer/angular-media-player#events
from angular-media-player.
Related Issues (20)
- pause button not showing up
- Adding data to media object and displaying them during current track HOT 1
- add html media fragments
- selectivePlay behaving unexpectedly HOT 3
- Provisional headers
- Demo Pages not working in Safari 8.0
- Wrong calculation in seekPercentage() in examples. HOT 1
- Directive reloads the audio file after it's ended HOT 1
- Contributors needed for this little project HOT 3
- Error: [$injector:unpr] Unknown provider: mediaPlayerProvider <- mediaPlayer
- Not playing... HOT 1
- How can i access mediaPlayer functions from controller? HOT 1
- Missing scope variable playerName HOT 1
- Attempting to use this with a custom playlist array
- Error event not caught
- ID3 tags from streaming: title, transmission name...
- player.stop() remove <source> HOT 2
- event bind method does not working
- How to use this package into angular 7 HOT 1
- audioprocess eventing stopped after finish
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-media-player.