I launched a subprocess
to using its call
method to play a video on Window Media Player.
eg.
subprocess.call('"C:/Program Files (x86)/Windows Media Player/wmplayer.exe" "C:/Users/Public/Videos/Sample Videos/Wildlife.wmv"')
Now, how can I check if the playback is completed in the player for that particular video.
Is there is any direct Api available for the Windows Media Player
Or
there is a way to listen to the subprocess command launched using Popen
eg.
p = subprocess.Popen('"C:/Program Files (x86)/Windows Media Player/wmplayer.exe" "C:/Users/Public/Videos/Sample Videos/Wildlife.wmv"')
# while the placback is happening
p.wait()
# otherwise
p.kill()