2004-10-24, 09:31
folks,
i am trying to write a simple python script that plays two video files - red.avi and green.avi. each of these video files are 5 minutes long. i want them to be played in this particular manner:
minute 1 of red.avi
minute 1 of green.avi
minute 2 of red.avi
minute 2 of green.avi
minute 3 of red.avi
minute 3 of green.avi
minute 4 of red.avi
minute 4 of green.avi
minute 5 of red.avi
minute 5 of green.avi
i was trying to use the logic below.
1. declare two instances of xbmc.player() - say, player_red and player_green.
2. player_red.play("red.avi")
time.sleep(oneminute)
player_red.pause()
player_green.play("green.avi")
time.sleep(oneminute)
for (i = 0; i < 4; i++)
player_green.pause() # pause and resume alternatively
player_red.pause() # resume and pause alternatively
time.sleep(oneminute)
however, this script only plays a few seconds of "red.avi" and then switches completely to "green.avi" with some pausing in between.
i tried to dig in a bit deeper and found that in namespace pyxbmc, player_play calls mediaplay with the filename, however player_pause calls mediapause without any argument. does this imply that a call to pause disregards the stream that is being played by the object on which pause is invoked, while play does take into account the stream? if so, why the disconnect?
could someone please help? :help:
thanks,
ranga
i am trying to write a simple python script that plays two video files - red.avi and green.avi. each of these video files are 5 minutes long. i want them to be played in this particular manner:
minute 1 of red.avi
minute 1 of green.avi
minute 2 of red.avi
minute 2 of green.avi
minute 3 of red.avi
minute 3 of green.avi
minute 4 of red.avi
minute 4 of green.avi
minute 5 of red.avi
minute 5 of green.avi
i was trying to use the logic below.
1. declare two instances of xbmc.player() - say, player_red and player_green.
2. player_red.play("red.avi")
time.sleep(oneminute)
player_red.pause()
player_green.play("green.avi")
time.sleep(oneminute)
for (i = 0; i < 4; i++)
player_green.pause() # pause and resume alternatively
player_red.pause() # resume and pause alternatively
time.sleep(oneminute)
however, this script only plays a few seconds of "red.avi" and then switches completely to "green.avi" with some pausing in between.
i tried to dig in a bit deeper and found that in namespace pyxbmc, player_play calls mediaplay with the filename, however player_pause calls mediapause without any argument. does this imply that a call to pause disregards the stream that is being played by the object on which pause is invoked, while play does take into account the stream? if so, why the disconnect?
could someone please help? :help:
thanks,
ranga