On iOS there is button to close video in native controls. On android you use hardware back button.
If it will help there are some facts.
When on ios and android video ends then onComplete function is triggered. When you open video on ios, application is still running in the background. When you 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 you open player then it will take a fraction of second but android will suspend app and app will pause executing code.
So if you write
-- 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.
I must emphassise that if you 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.