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 insert YouTube video in the 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: 6607

PostPosted: Tue Feb 09, 2010 3:11 pm    Post subject: [Demo] How to insert YouTube video in the editor Reply with quote

This demo shows how to insert a YouTube video in TRichViewEdit:
http://www.trichview.com/support/files/youtube.zip

This demo uses "Shockwave Flash" ActiveX (as TShockWaveFlash component).

The user enters the video URL (in the form http://www.youtube.com/watch?v=VIDEOID). The program creates TShockWaveFlash control and assign its Movie property to play the specified video.
Back to top
View user's profile Send private message Visit poster's website
ekoindri



Joined: 30 May 2010
Posts: 14
Location: Indonesia

PostPosted: Mon Aug 02, 2010 9:21 am    Post subject: Reply with quote

Could you show me how to save TRichViewEdit + Youtube to HTML file?

Is this possible to be done?
If this can be realized, it will be so amazing.
Back to top
View user's profile Send private message Yahoo Messenger
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6607

PostPosted: Mon Aug 02, 2010 3:54 pm    Post subject: Reply with quote

Use OnSaveComponentToFile event:
Code:
procedure TForm1.RichViewEdit1SaveComponentToFile(Sender: TCustomRichView;
  Path: String; SaveMe: TPersistent; SaveFormat: TRVSaveFormat;
  var OutStr: String);
begin
  if (SaveFormat=rvsfHTML) and (SaveMe is TShockwaveFlash) then begin
     OutStr := Format(
       '<object width="%d" height="%d">'+
        '<param name="movie" value="%s"></param>'+
        '<param name="allowFullScreen" value="true"></param>'+
        '<param name="allowscriptaccess" value="always"></param>'+
        '<embed src="%s" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="%d" height="%d"></embed>'+
       '</object>',
         [TShockwaveFlash(SaveMe).Width, TShockwaveFlash(SaveMe).Height,
          TShockwaveFlash(SaveMe).Movie,
          TShockwaveFlash(SaveMe).Movie,
          TShockwaveFlash(SaveMe).Width, TShockwaveFlash(SaveMe).Height]);
  end;
end;
Back to top
View user's profile Send private message Visit poster's website
ekoindri



Joined: 30 May 2010
Posts: 14
Location: Indonesia

PostPosted: Tue Aug 03, 2010 1:22 am    Post subject: Reply with quote

@Sergey Tkachenko

Wow...your code above work properly.
Now, I have a problem.
When I sent it via email and I open it with Microsoft OutLook, I can not see
the youtube. What I have to do in order to see the video from email.

Actually, I want to send mass email to my friends and they can see the
video when open the email.

Do you think that this issue is possible to be done by TRichView?
Back to top
View user's profile Send private message Yahoo Messenger
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6607

PostPosted: Tue Aug 03, 2010 7:18 am    Post subject: Reply with quote

I am afraid no, this problem cannot be solved in TRichView.
Either Outlook does not support flash objects, or some (security) settings must be changed in it to view youtube videos.
Sorry, I do not use Outlook myself.
Back to top
View user's profile Send private message Visit poster's website
ekoindri



Joined: 30 May 2010
Posts: 14
Location: Indonesia

PostPosted: Tue Aug 03, 2010 12:58 pm    Post subject: Reply with quote

@Sergey Tkachenko

Thanks for your explanation. You're right, MS OutLook does not support for
showing the youtube video directly. It seems that I have to create it by
myself, so I do not need to use Microsoft Outlook anymore.

Any way, your code above has provided me a hint so useful to achieve this
issue.

regards,


Eko Indriyawan
Back to top
View user's profile Send private message Yahoo Messenger
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