StringDictionary values for BuildVideoTag
Answers
-
Hi @endpointsystems,
You can use any attribute of the HTML5 video tag. e.g.,
autoplay
,controls
,height
,loop
,muted
,preload
(see w3schools for details on HTML5 attributes).
Here are some of the options you can use:sourceTypes
: The source types for the video tag (e.g., “webm”, “ogv”, “mp4”).
fallbackContent
: The content to display if the video cannot be played.
poster
: The URL of an image to display before the video is played.
autoplay
: Whether the video should start playing as soon as it’s ready.
controls
: Whether to display the browser’s default video controls.
loop
: Whether the video should start over again every time it’s finished.
muted
: Whether the video should be muted by default.
preload
: Specifies if and how the author thinks the video should be loaded when the page loads.
- You can read more about it in the following section:
https://cloudinary.com/documentation/video_manipulation_and_delivery#cloudinary_video_tag_helper_method
Here is an example:var videoTag = cloudinary.Api.UrlVideoUp
.Transform(new Transformation()
.Width(300).Height(300).Crop("fill")
.Chain()
.Overlay(new Layer().PublicId("video_play_button")).Width(50).Gravity("center"))
.Format("mp4")
.BuildVideoTag("a10v20_bkrbsj", new StringDictionary("autoplay","muted=true","preload","controls=abc"));
You can pass both single value and key=value pairs to the StringDictionary,Hope you find it useful!
Please let me know if you have additional questions.
Best Regards,Wissam
1 -
Perfect, thank you!
0