Video 컴포넌트 — sgcHTML | eSeGeCe

Video

TsgcHTMLComponent_Video — Delphi, C++ Builder 및 .NET에서 YouTube 임베드 헬퍼와 함께 반응형 HTML5 비디오 또는 오디오 플레이어를 렌더링합니다.

TsgcHTMLComponent_Video

<video> 또는 <audio> 요소를 내보내는 HTML5 미디어 플레이어입니다. 소스와 재생 옵션을 설정한 다음, HTML 속성을 읽습니다.

컴포넌트 클래스

TsgcHTMLComponent_Video

렌더링

HTML5 <video> / <audio> 미디어

언어

Delphi, C++ Builder, .NET

생성하고, 소스를 설정하고, 렌더링하기

SrcMediaType을 할당하고, Controls, AutoplayResponsive를 토글한 다음, HTML을 읽습니다 — 또는 정적 BuildBuildYouTube 헬퍼를 사용하십시오.

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, LoopMuted는 HTML5 미디어 속성에 직접 매핑됩니다.

크기 조정

WidthHeight는 플레이어 치수를 설정합니다. Responsive는 비디오를 16:9 반응형 비율 컨테이너로 감쌉니다.

포스터

Poster는 비디오가 재생되기 전에 플레이스홀더 프레임을 표시합니다. VideoID는 DOM id를 설정합니다.

YouTube

BuildYouTube(aVideoID, aWidth, aHeight)는 단일 정적 호출로 반응형 YouTube iframe 임베드를 반환합니다.

한 줄 빌드

Build(aSrc, aMediaType, aControls)는 단일 정적 호출로 플레이어 HTML을 반환합니다. HTML은 구성된 인스턴스를 렌더링합니다.

계속 살펴보기

온라인 도움말이 찱포넌트의 전체 API 참조 및 사용 가이드입니다.
모든 sgcHTML 컴포넌트60개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 및 .NET에서 웹 UI를 구축하기 시작하십시오.