TMediaPlayer problem
- From: MaHi <nospam@xxxxxxxxxx>
- Date: Tue, 13 May 2008 14:37:22 +0200
Hello,
I'm working on a simple programs that has to play WMV videos based on
a Time Schedule.
If a WMV length is less than the play time fixed in the schedule I
have to replay the video till the end time in the Schedule.
My problem is that sometimes TMediaPlayes stops from replaying my
video.
To implement the replay function I use the OnNotify event in
TMediaPlayer. The code is:
If TraceEnabled Then WriteLn( FDebug, ' OnNotify:
['+TimeToStr(Now)+'] NotifyValue = ' + NVToStr(MP.NotifyValue) + ',
OnPlay = ' + BoolToStr(TimeSchedule.OnPlay) + ', IsVideo = ' +
BoolToStr(TimeSchedule.IsVideo) + ', Loop = ' +
BoolToStr(TimeSchedule.OnPlay) );
If (MP.NotifyValue = nvSuccessful)And(TimeSchedule.OnPlay)
And(TimeSchedule.IsVideo)And(TimeSchedule.Loop) Then
Begin
If TraceEnabled Then WriteLn( FDebug, ' OnNotify:
['+TimeToStr(Now)+'] Re-Play del video appena concluso');
MP.Play;
MP.Notify := True;
End;
TraceEnabled isa a Boolean that is TRUE if I want debug infos saved on
a text file.
For example this is the trace that i've got for a scheduel that has to
replay a video from 10:35 to 11:00 :
OnNotify: [10.35.01] NotifyValue = nvAborted, OnPlay = -1, IsVideo =
-1, Loop = -1
OnNotify: [10.35.01] NotifyValue = nvSuccessful, OnPlay = -1, IsVideo
= -1, Loop = -1
OnNotify: [10.35.01] Re-Play del video appena concluso
OnNotify: [10.35.01] NotifyValue = nvSuperseded, OnPlay = -1, IsVideo
= -1, Loop = -1
OnNotify: [10.37.52] NotifyValue = nvSuccessful, OnPlay = -1, IsVideo
= -1, Loop = -1
OnNotify: [10.37.52] Re-Play del video appena concluso
OnNotify: [10.37.52] NotifyValue = nvAborted, OnPlay = -1, IsVideo =
-1, Loop = -1
OnNotify: [10.40.44] NotifyValue = nvSuccessful, OnPlay = -1, IsVideo
= -1, Loop = -1
OnNotify: [10.40.44] Re-Play del video appena concluso
OnNotify: [10.40.44] NotifyValue = nvAborted, OnPlay = -1, IsVideo =
-1, Loop = -1
OnNotify: [10.40.44] NotifyValue = nvAborted, OnPlay = -1, IsVideo =
-1, Loop = -1
the video playback restart at 10:35 , 10:37 and 10:40 and then stops.
I can't understand NotifyValue different from "nvSuccessful" (why
nvAborted? why nvSuperseded? ) but it seems that the double
"nvAborted" stops the replay.
Does anyone has some suggestion?
Thank you
LUCA
.
- Prev by Date: Protect yourself against Operation Sudden Fall
- Next by Date: wait for replay
- Previous by thread: Protect yourself against Operation Sudden Fall
- Next by thread: wait for replay
- Index(es):
Relevant Pages
|