Inquiry About YouTube Playback Control in TMSFNCWX Components

Hello TMSFNC Wonderful Team,

I’m currently working with the TTMSFNCWXVideoPlayer and TTMSFNCWXWebBrowser components. I would like to know whether it is possible to programmatically load and control the playback of a YouTube video (whether I’m the author or not) by specifying:

  • A custom start time
  • A custom end time

In other words, is there a way to download or stream the video with control over which portion of the video is played?

Any guidance or suggestions on how to implement such a feature using your components would be greatly appreciated.

Best regards,
Bishara Wakim

Hi,

The TTMSFNCWXVideoPlayer does not support Youtube playback. It is based on the browser Video API which only enables you to load certain formats like mp4, ...

Best regards,

Thank you for your reply regarding TTMSFNCWXVideoPlayer and YouTube playback.
However, in my original question, I also mentioned TTMSFNCWXWebBrowser, as I suspected TTMSFNCWXVideoPlayer might not support YouTube directly.

My main request was about whether it’s possible, using either component, to programmatically play only a specific portion of a YouTube video (custom start and end times).
I understand now that TTMSFNCWXVideoPlayer is not an option for YouTube, but I was hoping your answer could also address whether TTMSFNCWXWebBrowser could be used for this — for example, via the YouTube IFrame Player API or embed parameters (?start=xx&end=yy).

I would appreciate clarification on this point, so I don’t need to wait multiple days for separate replies when the full picture could be given at once.

Thank you for your understanding and support,
Best regards,
Bishara Wakim

Hello,

To avoid confusion, there is no TTMSFNCWXWebBrowser but TTMSFNCWebBrowser.
Normally, you can do everything with it that you could with a standard (embedded) web browser, so if you can do it in the browser, it should be fine in TTMSFNCWebBrowser too. It offers loading HTML directly: TTMSFNCWebBrowser - TMS FNC Core

The rest really depends on the YouTube API which isn't within our scope. However, a quick search should reveal what HTML element(s) you need and how to add it to your page. We found this for example for embedded YouTube videos (iframe + added styling for full page view):

procedure TForm1.Button1Click(Sender: TObject);
begin
  //Play 10 second clip
  LoadVideo('07hTCBH8goQ', 1244, 1254);
end;

procedure TForm1.LoadVideo(VideoID: string; StartTime, EndTime: Integer);
var
  frame: string;
begin
  frame := '<iframe style="position:fixed;top:0px;bottom:0px;right:0px;width:100%;' +
   'border:none;margin:0;padding:0;overflow:hidden;z-index:999999;height:100%" ' +
   'type="text/html" src="https://www.youtube.com/embed/' + VideoID +
   '?start=' + StartTime.ToString + '&end=' + EndTime.ToString + '"></iframe>';

  TMSFNCWebBrowser1.LoadHTML(frame);
end;

There is also an autoplay parameter but it does not work without initial user interaction so you'd need to use a mute as well to make it play automatically (without sound).

I was very helpful.
Thank you very much

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.