Video
TsgcHTMLComponent_Video — affichez un lecteur vidéo ou audio HTML5 responsive, ainsi qu'un assistant d'intégration YouTube, en Delphi, C++ Builder et .NET.
TsgcHTMLComponent_Video — affichez un lecteur vidéo ou audio HTML5 responsive, ainsi qu'un assistant d'intégration YouTube, en Delphi, C++ Builder et .NET.
Un lecteur multimédia HTML5 qui émet un élément <video> ou <audio>. Définissez la source et les options de lecture, puis lisez la propriété HTML.
TsgcHTMLComponent_Video
Média HTML5 <video> / <audio>
Delphi, C++ Builder, .NET
Affectez Src et MediaType, activez Controls, Autoplay et Responsive, puis lisez HTML — ou utilisez les assistants statiques Build et 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");
Les membres que vous utilisez le plus souvent.
Src définit l'URL du média et MediaType (TsgcHTMLMediaType : mtVideo, mtAudio) choisit l'élément rendu.
Controls, Autoplay, Loop et Muted correspondent directement aux attributs média HTML5.
Width et Height définissent les dimensions du lecteur ; Responsive enveloppe une vidéo dans un conteneur de ratio responsive 16:9.
Poster affiche une image d'aperçu avant la lecture d'une vidéo ; VideoID définit l'identifiant DOM.
BuildYouTube(aVideoID, aWidth, aHeight) renvoie une intégration YouTube responsive en iframe en un seul appel statique.
Build(aSrc, aMediaType, aControls) renvoie le HTML du lecteur en un seul appel statique ; HTML rend une instance configurée.
| Tous les composants sgcHTMLParcourez la matrice complète des fonctionnalités de plus de 60 composants. | Ouvrir | |
| Télécharger la version d'essai gratuiteLa version d'essai de 30 jours fournit les projets de démonstration 60.HTML. | Ouvrir | |
| TarifsLicences Single, Team et Site avec code source complet. | Ouvrir |