Search Results for

    Show / Hide Table of Contents
    View Source

    Class OEmbedService

    Implements IOEmbedService for retrieving embeddable HTML markup using the oEmbed protocol.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public class OEmbedService : IOEmbedService

    Constructors

    View Source

    OEmbedService(EmbedProvidersCollection, ILogger<OEmbedService>)

    Initializes a new instance of the OEmbedService class.

    Declaration
    public OEmbedService(EmbedProvidersCollection embedProvidersCollection, ILogger<OEmbedService> logger)
    Parameters
    Type Name Description
    EmbedProvidersCollection embedProvidersCollection
    ILogger<OEmbedService> logger

    Methods

    View Source

    GetMarkupAsync(Uri, int?, int?, CancellationToken)

    Asynchronously retrieves the embeddable HTML markup for the specified resource.

    Declaration
    public Task<Attempt<string, OEmbedOperationStatus>> GetMarkupAsync(Uri url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Uri url

    The URI of the resource to retrieve markup for. Must be a valid, absolute URI.

    int? maxWidth
    int? maxHeight
    CancellationToken cancellationToken

    A token to monitor for cancellation requests. The operation is canceled if the token is triggered.

    Returns
    Type Description
    Task<Attempt<string, OEmbedOperationStatus>>

    A task that represents the asynchronous operation. The result contains an Attempt with the HTML markup if successful, or an oEmbed operation status indicating the reason for failure.

    Remarks

    The returned markup is suitable for embedding in web pages. The width and height parameters may be ignored by some providers depending on their capabilities.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX