Re: Want to display the last frame of the media in the playlist
- From: "Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx>
- Date: Tue, 08 Nov 2005 16:46:54 GMT
On Tue, 8 Nov 2005 08:12:12 -0800, "John"
<John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>I am using the ActiveX component in Delphi for the WindowsMediaPlayer 10. I
>have created the playlist that is needed and play the file. I am trying to
>have the video stop on the last frame in the file.
You should be able to set
WindowsMediaPlayer1.settings.Set_Mode("showframe", TRUE)
(Or whatever the equivalent syntax is in Delphi, which I have no idea
!)
> Should markers be put in
>the wpl file and go to the marker? I have set the currentposition to the end
>time (duration) but it seems to either keep playing to the next file in the
>playlist (I want to play one file at a time) or goes to the wrong frame(maybe
>due to keyframes). I am using a playlist(wpl file) using wmv files within
>the playlist. The playlist is used since a very noticeable lag time occurred
>when playing the files separately.
>
>Will using markers have the last frame show in the video? If so how are the
>markers set? Is there a different approach with a setting to keep the last
>frame displayed after playing the media?
>
>WPL file:
><?wpl version="1.0"?>
><smil>
> <head>
> <meta name="Generator" content="Microsoft Windows Media Player --
>10.0.0.3802"/>
> <author/>
> <title>All</title>
> </head>
> <body>
> <seq>
> <media src="\\..\35569.wmv"
>tid="{B8AF3018-D023-442C-873A-3D64CEA184EA}"/>
> <media src="\\..\35570.wmv"
>tid="{8E80668B-FDF3-4F32-9AEF-D8BE9C4AF14F}"/>
> </seq>
> </body>
></smil>
>
>
>Some code follows:
>
> WindowsMediaPlayer1.currentPlaylist := WMPPlaylist ;
> For i := 0 To WindowsMediaPlayer1.currentplaylist.Count -1 Do
> Begin
> If WindowsMediaPlayer1.currentplaylist.item[i].name = sName Then
> Begin
> bLock := TRUE ;
> WindowsMediaPlayer1.Perform(wm_SetRedraw,0,0) ;
>
> WindowsMediaPlayer1.controls.stop ;
>
>
>WindowsMediaPlayer1.controls.Set_currentItem(WindowsMediaPlayer1.currentPlayList.Item[i]) ;
>
> WindowsMediaPlayer1.controls.play ;
>
> While (WindowsMediaPlayer1.playState <> wmppsReady) and
> (WindowsMediaPlayer1.controls.CurrentPosition { in seconds } <
>WindowsMediaPlayer1.currentMedia.duration { HH:MM:SS.fract } ) Do
> Begin
> { Unlock as soon as the mediaplayer starts playing }
> If bLock and (WindowsMediaPlayer1.playState = wmppsPlaying) Then
> Begin
> bLock := FALSE ;
> WindowsMediaPlayer1.Perform(wm_SetRedraw,1,0) ;
> End ;
>
> If bStop or bMisRec Then
> Begin
> WindowsMediaPlayer1.settings.mute := TRUE ;
> WindowsMediaPlayer1.controls.pause ;
> WindowsMediaPlayer1.controls.CurrentPosition :=
>WindowsMediaPlayer1.currentMedia.duration -1 ;
> WindowsMediaPlayer1.controls.play ;
>
> WindowsMediaPlayer1.controls.currentMarker := 1 ;
>
> End ;
>
> Application.HandleMessage ;
> End ;
>
> { Pause on the last frame }
> WindowsMediaPlayer1.controls.pause ;
> While WindowsMediaPlayer1.controls.CurrentPosition <>
>WindowsMediaPlayer1.currentMedia.duration Do
> Begin
> WindowsMediaPlayer1.controls.CurrentPosition :=
>WindowsMediaPlayer1.currentMedia.duration ;
> WindowsMediaPlayer1.controls.pause ;
> RedrawWindow( Handle, nil, 0,
> RDW_ERASE or RDW_INVALIDATE or RDW_ERASENOW or RDW_UPDATENOW or
> RDW_ALLCHILDREN );
>
> Application.HandleMessage ;
> Invalidate ;
>
> If FloatToStr(WindowsMediaPlayer1.controls.CurrentPosition) =
>FloatToStr(WindowsMediaPlayer1.currentMedia.duration) Then
> Break ;
> End ;
.
- References:
- Prev by Date: Want to display the last frame of the media in the playlist
- Next by Date: Media Player SDK - DRM License Provider Question
- Previous by thread: Want to display the last frame of the media in the playlist
- Next by thread: Re: Want to display the last frame of the media in the playlist
- Index(es):
Relevant Pages
|