| View previous topic :: View next topic |
| Author |
Message |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Tue Feb 09, 2010 3:11 pm Post subject: [Demo] How to insert YouTube video in the editor |
|
|
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 |
|
 |
ekoindri
Joined: 30 May 2010 Posts: 14 Location: Indonesia
|
Posted: Mon Aug 02, 2010 9:21 am Post subject: |
|
|
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 |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Mon Aug 02, 2010 3:54 pm Post subject: |
|
|
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 |
|
 |
ekoindri
Joined: 30 May 2010 Posts: 14 Location: Indonesia
|
Posted: Tue Aug 03, 2010 1:22 am Post subject: |
|
|
@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 |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Tue Aug 03, 2010 7:18 am Post subject: |
|
|
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 |
|
 |
ekoindri
Joined: 30 May 2010 Posts: 14 Location: Indonesia
|
Posted: Tue Aug 03, 2010 12:58 pm Post subject: |
|
|
@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 |
|
 |
|