trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Demo] How to play AVI files in editor

 
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos
View previous topic :: View next topic  
Author Message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Wed Oct 19, 2005 4:46 pm    Post subject: [Demo] How to play AVI files in editor Reply with quote

http://www.trichview.com/support/files/aviplayer.zip

This demo shows:
- how to play AVI files in editor using TPanel and TMediaPlayer
- how to implement resizing of AVI players
- how to export documents containing AVI players to HTML
- how to allow saving and loading documents containing AVI players in RVF



This demo does not support drag&drop of controls. See here for details:
http://www.trichview.com/forums/viewtopic.php?t=157

(2008-Dec-9: updated according to suggestions below:
- OnItemAction is used to reassign Display;
- hint with file name;
- Rewind button is shown instead of Stop)


Last edited by Sergey Tkachenko on Tue Dec 09, 2008 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
shmp



Joined: 28 Aug 2005
Posts: 140
Location: Sabah, Malaysia.

PostPosted: Wed Oct 26, 2005 3:19 am    Post subject: Reply with quote

Could something be done about this avi procedures? It doesn't seem to work within a table. I tried to figure out but its a very painstaking effort. Need someting less time-consuming.

Thanks in advance.
Back to top
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Wed Oct 26, 2005 3:31 pm    Post subject: Reply with quote

Sorry, I do not understand your question. Which kind of "avi procedures"?
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Oct 27, 2005 2:24 am    Post subject: Reply with quote

Sorry for being very brief. Within a table, the resize caused an error. If clicked anywhere other then the panel itself (even outside the table), the resize-procedure is activated thus causing an error. Only when the actual resizing is preformed should the resize-procedure be activated. Could you please check this for me.

Thanks.
Back to top
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Thu Oct 27, 2005 1:43 pm    Post subject: Reply with quote

It looks like TMediaPlayer does not like changing Parent of its Display conntrol.
Use OnItemActionItem to reassign Display:

Code:
procedure TForm1.RichViewEdit1ItemAction(Sender: TCustomRichView;
  ItemAction: TRVItemAction; Item: TCustomRVItemInfo; var Text: String;
  RVData: TCustomRVData);
var Panel, VideoPanel: TPanel;
    Player: TMediaPlayer;
begin
  if csDestroying in Sender.ComponentState then
    exit;
  if (ItemAction=rviaInserted) and (Item.StyleNo=rvsComponent) and
    (TRVControlItemInfo(Item).Control is TPanel) then begin
    Panel      := TRVControlItemInfo(Item).Control as TPanel;
    VideoPanel := Panel.Components[0] as TPanel;
    Player     := Panel.Components[1] as TMediaPlayer;
    Player.Display := VideoPanel;
  end;
end;
Back to top
View user's profile Send private message Visit poster's website
shmp



Joined: 28 Aug 2005
Posts: 140
Location: Sabah, Malaysia.

PostPosted: Fri Oct 28, 2005 12:08 am    Post subject: Reply with quote

Many thanks. I will do that.

Cheers Very Happy
Back to top
View user's profile Send private message Visit poster's website
wvd_vegt



Joined: 30 Aug 2005
Posts: 84

PostPosted: Fri Oct 28, 2005 8:54 am    Post subject: Reply with quote

Hi,

Not related to the problem but nice to add is the next line:

VideoPanel.Hint := Format('%s [%d x %d]', [ExtractFileName(Player.FileName), VideoPanel.Width, VideoPanel.Height]);

which will display a nice yellow hint when the mouse is over the videoplayer.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Fri Oct 28, 2005 12:28 pm    Post subject: Reply with quote

One more suggestion: I just noticed that the TMediaPlayer's Stop button does not reset the movie position to the beginning (so I do not understand what's the difference between Stop and Pause buttons), so hiding additional buttons may be undesirable.
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Oct 29, 2005 2:58 am    Post subject: Reply with quote

For the player button (namely stop button), I have to reset the position using on notify event - this is one of the incomplete thing in TMediaPlayer. The event is available in the player itself.
Back to top
gacek999



Joined: 06 Dec 2005
Posts: 7

PostPosted: Tue Dec 06, 2005 10:24 pm    Post subject: Reply with quote

Can we have embedded Windows Media Player control
like TMediaPlayer ? TMediaPlayer also is build on Windows
control, but I want to see original buttons, trackbar, and so on.
We often see this embedded players on websites.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Sun Dec 11, 2005 7:38 pm    Post subject: Reply with quote

Create Windows Mediaplayer ActiveX: "Component | Import ActiveX Control", select "Windows Media Player (Version 1.0)", and install it. New control (TWindowsMediaPlayer) will be available in the Component Palette, the page "ActiveX".
Video file name can be specified in URL property. I did not try to insert it in TRichView, but I do not think that there will be problems. It even simpler than the example above, because the control includes both video screen and VCR buttons.
Back to top
View user's profile Send private message Visit poster's website
hruslan2000



Joined: 29 Aug 2005
Posts: 74

PostPosted: Mon Feb 20, 2006 12:26 pm    Post subject: Reply with quote

How to save media source in RVF file with using TWindowsMediaPlayer?

Media player is registered with RegisterClasses([TWindowsMediaPlayer]).
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Mon Feb 20, 2006 7:01 pm    Post subject: Reply with quote

I think it can be done only by creating inherited component with new property, containing media data.
It's something that was done for the Flash ActiveX here:
http://www.trichview.com/forums/viewtopic.php?t=72
Back to top
View user's profile Send private message Visit poster's website
ziclope



Joined: 31 Aug 2005
Posts: 84

PostPosted: Mon Feb 20, 2006 7:16 pm    Post subject: Reply with quote

Oh itīs great!

Exists any C++Builder demo ?

Regards
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Sun Feb 26, 2006 12:50 pm    Post subject: Reply with quote

http://www.trichview.com/support/files/MyShockwaveFlashCPP.zip
It has problems with the flash (see that topic), but may be it will work properly for media player.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group