Adds a few more providers to the collection
This commit is contained in:
24
src/Umbraco.Web/Media/EmbedProviders/SoundCloud.cs
Normal file
24
src/Umbraco.Web/Media/EmbedProviders/SoundCloud.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Web.Media.EmbedProviders
|
||||
{
|
||||
public class Soundcloud : EmbedProviderBase
|
||||
{
|
||||
public override string ApiEndpoint => "https://soundcloud.com/oembed";
|
||||
|
||||
public override string[] UrlSchemeRegex => new string[]
|
||||
{
|
||||
@"soundcloud.com\/*"
|
||||
};
|
||||
|
||||
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
|
||||
|
||||
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
|
||||
{
|
||||
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
|
||||
var xmlDocument = base.GetXmlResponse(requestUrl);
|
||||
|
||||
return GetXmlProperty(xmlDocument, "/oembed/html");
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/Umbraco.Web/Media/EmbedProviders/Ted.cs
Normal file
24
src/Umbraco.Web/Media/EmbedProviders/Ted.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Web.Media.EmbedProviders
|
||||
{
|
||||
public class Ted : EmbedProviderBase
|
||||
{
|
||||
public override string ApiEndpoint => "http://www.ted.com/talks/oembed.xml";
|
||||
|
||||
public override string[] UrlSchemeRegex => new string[]
|
||||
{
|
||||
@"ted.com\/talks\/*"
|
||||
};
|
||||
|
||||
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
|
||||
|
||||
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
|
||||
{
|
||||
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
|
||||
var xmlDocument = base.GetXmlResponse(requestUrl);
|
||||
|
||||
return GetXmlProperty(xmlDocument, "/oembed/html");
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/Umbraco.Web/Media/EmbedProviders/Vimeo.cs
Normal file
24
src/Umbraco.Web/Media/EmbedProviders/Vimeo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Web.Media.EmbedProviders
|
||||
{
|
||||
public class Vimeo : EmbedProviderBase
|
||||
{
|
||||
public override string ApiEndpoint => "https://vimeo.com/api/oembed.xml";
|
||||
|
||||
public override string[] UrlSchemeRegex => new string[]
|
||||
{
|
||||
@"vimeo\.com/"
|
||||
};
|
||||
|
||||
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
|
||||
|
||||
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
|
||||
{
|
||||
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
|
||||
var xmlDocument = base.GetXmlResponse(requestUrl);
|
||||
|
||||
return GetXmlProperty(xmlDocument, "/oembed/html");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,11 @@ namespace Umbraco.Web.Runtime
|
||||
.Append<Kickstarter>()
|
||||
.Append<GettyImages>()
|
||||
.Append<Instagram>()
|
||||
.Append<Twitter>();
|
||||
.Append<Twitter>()
|
||||
.Append<Vimeo>()
|
||||
.Append<Ted>()
|
||||
.Append<Soundcloud>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,6 +148,9 @@
|
||||
<Compile Include="Media\EmbedProviders\EmbedProvidersCollectionBuilder.cs" />
|
||||
<Compile Include="Media\EmbedProviders\Flickr.cs" />
|
||||
<Compile Include="Media\EmbedProviders\GettyImages.cs" />
|
||||
<Compile Include="Media\EmbedProviders\SoundCloud.cs" />
|
||||
<Compile Include="Media\EmbedProviders\Ted.cs" />
|
||||
<Compile Include="Media\EmbedProviders\Vimeo.cs" />
|
||||
<Compile Include="Media\EmbedProviders\Twitter.cs" />
|
||||
<Compile Include="Media\EmbedProviders\Kickstarter.cs" />
|
||||
<Compile Include="Media\EmbedProviders\OEmbedResponse.cs" />
|
||||
|
||||
Reference in New Issue
Block a user