StringDictionary values for BuildVideoTag

endpointsystems Member Posts: 6

Where can I get a list of the values/options supported for this function? The only ones I can seem to find are the ones listed in the examples.




  • Wissam
    Wissam Member, Cloudinary Staff Posts: 76

    Hi @endpointsystems,

    You can use any attribute of the HTML5 video tag. e.g., autoplaycontrolsheightloopmutedpreload (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:

    Here is an example:

    var videoTag = cloudinary.Api.UrlVideoUp
    .Transform(new Transformation()
    .Overlay(new Layer().PublicId("video_play_button")).Width(50).Gravity("center"))
    .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,


  • endpointsystems
    endpointsystems Member Posts: 6

    Perfect, thank you!