Kaku icon indicating copy to clipboard operation
Kaku copied to clipboard

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

Open moda20 opened this issue 5 years ago • 5 comments

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

moda20 avatar Aug 03 '19 20:08 moda20

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

EragonJ avatar Aug 04 '19 07:08 EragonJ

@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){

}

moda20 avatar Aug 04 '19 09:08 moda20

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 avatar Aug 05 '19 06:08 EragonJ

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 avatar Aug 05 '19 06:08 EragonJ

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

EragonJ avatar Aug 06 '19 07:08 EragonJ