Hi All,
I'm trying to little modify the built in Android Background Audio Player to send callback when the audio is finished.
I know there is function SendToScriptObject which is something what I'm looking for, but this only works on widget libraries. Is there any other function to send message to Livecode from LCB external Library?
Any help will be highly appreciated.
Thanks,
Gurgen
Send Message to Livecode from LCB Library
Re: Send Message to Livecode from LCB Library
@gurgen: I think this is what you are looking for - https://github.com/livecode/livecode/pull/6063 - this should be in dp-11
Re: Send Message to Livecode from LCB Library
Thanks Mark,
For some reason this syntax is working on example bellow:
But is not working here :
I assume the callbacks are not executed (I may be wrong).
Thanks for great support,
Gurgen
For some reason this syntax is working on example bellow:
Code: Select all
public handler NotifyMe() returns nothing
post "playerFinished" to the caller
end handler
Code: Select all
private handler bgaudioOnFinish(in pContext as JObject) returns nothing
mediaplayerStop()
put nothing into mContext
put nothing into mPendingAudio
post "playerFinished"
end handler
Thanks for great support,
Gurgen
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Send Message to Livecode from LCB Library
Hi Gurgen - you're missing a call to `MCEngineRunloopBreakWait()` after the `post` - this wakes up the engine thread. I'll file a bug as this should probably just happen behind the scenes without having to call it explicitly.
Let me know if that fixes your problem.
Let me know if that fixes your problem.
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Send Message to Livecode from LCB Library
Ha, looks like I already filed it.
http://quality.livecode.com/show_bug.cgi?id=19868
http://quality.livecode.com/show_bug.cgi?id=19868