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

Isn't there a clear interface to interact with the player ? #548

Open
moda20 opened this issue Aug 3, 2019 · 5 comments
Open

Isn't there a clear interface to interact with the player ? #548

moda20 opened this issue Aug 3, 2019 · 5 comments

Comments

@moda20
Copy link

moda20 commented Aug 3, 2019

Feature

Idea

isn't there a JS class that lets you hook to the existing player and control it ? like play videos from other sources that the already existing (I implemented local video file playing) ?

What is your Kaku version?

2.0.2

What is your OS (with version number)?

Mac 10.14.1

@EragonJ
Copy link
Owner

EragonJ commented Aug 4, 2019

@moda20 I don't understand your meaning, any example ?

@moda20
Copy link
Author

moda20 commented Aug 4, 2019

@EragonJ I mean is there a global class or object that I can access to handle the play in the app from my own new js file or are all the controls linked to the the built in controls.
basically tell me what should I do in js code if I want to play a video from a given URI. give me a simple body of a function like this :

function playFromURI(pathToFile){

}

@EragonJ
Copy link
Owner

EragonJ commented Aug 5, 2019

are all the controls linked to the the built in controls.

Yes, when you are using the play media key in your keyboard, it will trigger the play logic in Kaku. So maybe in your js file, you can try to watch whether there is play media key got pressed ?

But I don't think this will be precise enough because maybe for some special case, Kaku will not run (for example, if there is no track in your playlist)

@EragonJ
Copy link
Owner

EragonJ commented Aug 5, 2019

https://github.com/EragonJ/Kaku/blob/master/src/views/modules/Player.js#L463-L471

This is the main code that triggers player to play media. (the most correct one, so you can hook your js here)

@EragonJ
Copy link
Owner

EragonJ commented Aug 6, 2019

@moda20 Did my response answer your question :) ? If yes, I'll close this issue

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

2 participants