dispatch event complete when frame reach total frame and not playing anymore

FYI : already sync with upstream, only last commit is necessary.