Why on Android return button doesn't trigger onComplete of media.playVideo()?

As in topic. I use following workaround but is there a way to just have onComplete for both OSes?

When on ios and android video ends then onComplete function is triggered. When I open video on ios, application is still running in the background. When I close it using “ready” button (I’m not sure about lablel but it should be blue button in top left corner) also onComplete function is triggered.

 

On android when I open player then it will take a fraction of second but android will suspend app and app will pause executing code.

So for Android

-- 1st media.playVideo( .... ) print("playing") -- 2nd local function doSomething() print("playing delayed") end media.playVideo(...) timer.performWithDelay(250, doSomething)

In first case, “playing” will be printed instantly beacause it takes some little time to open player. However, in second case “playing delayed” won’t be printed until you close video. 

So if I interupt video on android (close it by hardware return button) then onComplete won’t trigger.

 

So if I’m on iOs then I use onComplete and if I’am on android then I use the same function but as delayed by timer.

Perhaps you can create a flag, then in the applicationSuspend or applicationExit check if the flag is true, then call doSomething()

I wrote in post above what is my workaround (last line)  :)

My point is why closing video with return button doesn’t trigger onComplete function?

Perhaps you can create a flag, then in the applicationSuspend or applicationExit check if the flag is true, then call doSomething()

I wrote in post above what is my workaround (last line)  :)

My point is why closing video with return button doesn’t trigger onComplete function?

Pressing back during the video activity will fire a completion event as of build 2148.

Pressing back during the video activity will fire a completion event as of build 2148.