Files
Umbraco-CMS/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs
Bjarke Berg 4f4bdba214 Revert "Revert breaking changes"
This reverts commit ac4fb6acf1.
2022-08-18 14:40:11 +02:00

30 lines
909 B
C#

using System.Xml;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders;
/// <summary>
/// Embed Provider for Vimeo the popular online video hosting, sharing, and services platform provider.
/// </summary>
public class Vimeo : OEmbedProviderBase
{
public Vimeo(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
{
}
public override string ApiEndpoint => "https://vimeo.com/api/oembed.xml";
public override string[] UrlSchemeRegex => new[] { @"vimeo\.com/" };
public override Dictionary<string, string> RequestParams => new();
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
{
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
XmlDocument xmlDocument = base.GetXmlResponse(requestUrl);
return GetXmlProperty(xmlDocument, "/oembed/html");
}
}