Video
TsgcHTMLComponent_Video — Delphi, C++ Builder ve .NET'te duyarlı bir HTML5 video veya ses oynatıcısının yanı sıra bir YouTube gömme yardımcısı işleyin.
TsgcHTMLComponent_Video — Delphi, C++ Builder ve .NET'te duyarlı bir HTML5 video veya ses oynatıcısının yanı sıra bir YouTube gömme yardımcısı işleyin.
Bir <video> veya <audio> öğesi üreten bir HTML5 medya oynatıcısı. Kaynağı ve oynatma seçeneklerini ayarlayın, ardından HTML özelliğini okuyun.
TsgcHTMLComponent_Video
HTML5 <video> / <audio> medyası
Delphi, C++ Builder, .NET
Src ve MediaType'ı atayın, Controls, Autoplay ve Responsive'ı açıp kapatın, ardından HTML'i okuyun — ya da statik Build ve BuildYouTube yardımcılarını kullanın.
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");
En sık başvurduğunuz üyeler.
Src, medya URL'sini ayarlar ve MediaType (TsgcHTMLMediaType: mtVideo, mtAudio), işlenen öğeyi seçer.
Controls, Autoplay, Loop ve Muted, doğrudan HTML5 medya özniteliklerine eşlenir.
Width ve Height, oynatıcı boyutlarını ayarlar; Responsive, bir videoyu 16:9 duyarlı oranlı bir kapsayıcıya sarar.
Poster, bir video oynamadan önce bir yer tutucu kare gösterir; VideoID, DOM kimliğini ayarlar.
BuildYouTube(aVideoID, aWidth, aHeight), tek bir statik çağrıda duyarlı bir YouTube iframe gömmesi döndürür.
Build(aSrc, aMediaType, aControls), oynatıcı HTML'ini tek bir statik çağrıda döndürür; HTML, yapılandırılmış bir örneği işler.