Interface IEmbedProvider
Defines a provider for embedding media content from external sources using OEmbed protocol.
Namespace: Umbraco.Cms.Core.Media
Assembly: Umbraco.Core.dll
Syntax
public interface IEmbedProvider
Properties
View SourceApiEndpoint
The OEmbed API Endpoint
Declaration
string ApiEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
RequestParams
A collection of querystring request parameters to append to the API URL
Declaration
Dictionary<string, string> RequestParams { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> |
Examples
?key=value&key2=value2
View SourceUrlSchemeRegex
A string array of Regex patterns to match against the pasted OEmbed URL
Declaration
string[] UrlSchemeRegex { get; }
Property Value
| Type | Description |
|---|---|
| string[] |
Methods
View SourceGetMarkupAsync(string, int?, int?, CancellationToken)
Gets the HTML markup for embedding the media content from the specified URL.
Declaration
Task<string?> GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The URL of the media to embed. |
| int? | maxWidth | The maximum width of the embedded content, or |
| int? | maxHeight | The maximum height of the embedded content, or |
| CancellationToken | cancellationToken | A cancellation token to observe while waiting for the task to complete. |
Returns
| Type | Description |
|---|---|
| Task<string> | A task that represents the asynchronous operation, containing the HTML markup or |