If you have a Mac computer and want to play music videos, you can use the following Applescript to force the videos to end on time.
You must compile the script and save it as a "Stay Open Application". Then run it in the background when playing music videos and the script will jump to the next track when it should:
-------------------------------------------------------------------------------- ---------------------------
-- This script should be compiled and saved as a "Stay Open" application
-- Start it running and it will jump to the next track when a music video
-- plays longer than its specified Stop time
property RunInterval : 1 -- number of seconds before running again to check for things to do
property TimeResolution : 0.2 -- granularity of our timing (for return values from the idle routine)
-- Globals
global TimeToQuit
-------------------------------------------------------------------------------- ---------------------------
-- Main routine called once at start up.
-- After that the script keeps running the idle routine to check for over-running videos
set TimeToQuit to false
return -- It will now run the idle routine with no delay
-------------------------------------------------------------------------------- ---------------------------
-- This is the idle handler that runs every RunInterval seconds to check on things to do
on idle
if TimeToQuit then
quit -- quit this scheduler
return -- ensure it quits without accessing iTunes again (which will abort the quit)
end if
return my CheckInterval() -- Check to see if everything is OK and set the next interval
-- The return value tells the OS when to run the idle routine again
end idle
-------------------------------------------------------------------------------- ---------------------------
-- This is the quit handler to allow us to quit when told
on quit
set TimeToQuit to true
continue quit
end quit
-------------------------------------------------------------------------------- ---------------------------
-- This routine checks to see if we need to jump to the next track at the end of a video
on CheckInterval()
set IdleTime to RunInterval -- default idle time
try
tell application "iTunes"
if player state = playing then
-- First see how many seconds we have left to play in this song
set SecsLeftToPlay to (finish of current track) - player position
-- If we are very close to the end of this song then just wait until the next one starts
if SecsLeftToPlay < TimeResolution then
if SecsLeftToPlay ≤ 0 then
next track -- To fix the bug introduced in 10.6.7 where it doesn't stop when told
else
delay SecsLeftToPlay
end if
set SecsLeftToPlay to (finish of current track) - player position -- Should be playing the next song by now
if SecsLeftToPlay ≤ 0 then
next track -- To fix the bug introduced in 10.6.7 where it doesn't stop when told
set SecsLeftToPlay to (finish of current track) - player position -- MUST be playing the next song by now
end if
end if
-- If we are going to start a new song before the regular idle time then set us to run near the beginning of the next song
if SecsLeftToPlay < IdleTime then set IdleTime to SecsLeftToPlay
end if
end tell
end try
if IdleTime < TimeResolution then set IdleTime to TimeResolution
return IdleTime -- The return value tells how long to wait before idle runs again
end CheckInterval