Video
TsgcHTMLComponent_Video — Delphi, C++ Builder 및 .NET에서 YouTube 임베드 헬퍼와 함께 반응형 HTML5 비디오 또는 오디오 플레이어를 렌더링합니다.
TsgcHTMLComponent_Video — Delphi, C++ Builder 및 .NET에서 YouTube 임베드 헬퍼와 함께 반응형 HTML5 비디오 또는 오디오 플레이어를 렌더링합니다.
<video> 또는 <audio> 요소를 내보내는 HTML5 미디어 플레이어입니다. 소스와 재생 옵션을 설정한 다음, HTML 속성을 읽습니다.
TsgcHTMLComponent_Video
HTML5 <video> / <audio> 미디어
Delphi, C++ Builder, .NET
Src와 MediaType을 할당하고, Controls, Autoplay 및 Responsive를 토글한 다음, HTML을 읽습니다 — 또는 정적 Build 및 BuildYouTube 헬퍼를 사용하십시오.
uses
sgcHTML_Component_Video;
var
oVid: TsgcHTMLComponent_Video;
begin
oVid := TsgcHTMLComponent_Video.Create(nil);
try
oVid.Src := '/media/intro.mp4';
oVid.MediaType := mtVideo;
oVid.Controls := True;
oVid.Poster := '/media/intro.jpg';
oVid.Responsive := True;
WebModule.Response := oVid.HTML; // <video> element
finally
oVid.Free;
end;
end;
// Or in a single line with the static helpers:
Result := TsgcHTMLComponent_Video.Build('/media/intro.mp4', mtVideo, True);
Result := TsgcHTMLComponent_Video.BuildYouTube('dQw4w9WgXcQ', '100%', '400');
// includes: sgcHTML_Component_Video.hpp
TsgcHTMLComponent_Video *oVid = new TsgcHTMLComponent_Video(NULL);
try
{
oVid->Src = "/media/intro.mp4";
oVid->MediaType = mtVideo;
oVid->Controls = true;
oVid->Poster = "/media/intro.jpg";
oVid->Responsive = true;
String html = oVid->HTML; // <video> element
}
__finally
{
delete oVid;
}
// Or in a single line with the static helpers:
String html = TsgcHTMLComponent_Video::Build("/media/intro.mp4", mtVideo, true);
String yt = TsgcHTMLComponent_Video::BuildYouTube("dQw4w9WgXcQ", "100%", "400");
using esegece.sgcWebSockets;
var video = new TsgcHTMLComponent_Video();
video.Src = "/media/intro.mp4";
video.MediaType = TsgcHTMLMediaType.mtVideo;
video.Controls = true;
video.Poster = "/media/intro.jpg";
video.Responsive = true;
string html = video.HTML; // <video> element
// Or in a single line with the static helpers:
string oneLine = TsgcHTMLComponent_Video.Build("/media/intro.mp4",
TsgcHTMLMediaType.mtVideo, true);
string yt = TsgcHTMLComponent_Video.BuildYouTube("dQw4w9WgXcQ", "100%", "400");
가장 자주 사용하게 되는 멤버.
Src는 미디어 URL을 설정하고 MediaType(TsgcHTMLMediaType: mtVideo, mtAudio)이 렌더링되는 요소를 선택합니다.
Controls, Autoplay, Loop 및 Muted는 HTML5 미디어 속성에 직접 매핑됩니다.
Width와 Height는 플레이어 치수를 설정합니다. Responsive는 비디오를 16:9 반응형 비율 컨테이너로 감쌉니다.
Poster는 비디오가 재생되기 전에 플레이스홀더 프레임을 표시합니다. VideoID는 DOM id를 설정합니다.
BuildYouTube(aVideoID, aWidth, aHeight)는 단일 정적 호출로 반응형 YouTube iframe 임베드를 반환합니다.
Build(aSrc, aMediaType, aControls)는 단일 정적 호출로 플레이어 HTML을 반환합니다. HTML은 구성된 인스턴스를 렌더링합니다.