Adds a few more providers to the collection
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
using System.Xml;
|
||||
|
||||
namespace Umbraco.Core.Media
|
||||
{
|
||||
public interface IEmbedSettingProvider
|
||||
{
|
||||
object GetSetting(XmlNode settingNode);
|
||||
}
|
||||
}
|
||||
@@ -647,7 +647,6 @@
|
||||
<Compile Include="Manifest\PackageManifest.cs" />
|
||||
<Compile Include="Manifest\DataEditorConverter.cs" />
|
||||
<Compile Include="Media\IEmbedProvider.cs" />
|
||||
<Compile Include="Media\IEmbedSettingProvider.cs" />
|
||||
<Compile Include="Media\OEmbedResult.cs" />
|
||||
<Compile Include="Media\OEmbedStatus.cs" />
|
||||
<Compile Include="Migrations\IPostMigration.cs" />
|
||||
|
||||
@@ -12,20 +12,6 @@
|
||||
</requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- Vimeo -->
|
||||
<provider name="Vimeo" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[vimeo\.com/]]></urlShemeRegex>
|
||||
<apiEndpoint><![CDATA[http://vimeo.com/api/oembed.xml]]></apiEndpoint>
|
||||
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web"></requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- Ted -->
|
||||
<provider name="Ted" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[ted\.com/]]></urlShemeRegex>
|
||||
<apiEndpoint><![CDATA[http://www.ted.com/talks/oembed.xml]]></apiEndpoint>
|
||||
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web"></requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- Issuu Settings -->
|
||||
<provider name="Issuu" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[issuu.com/(?:.*)/docs]]></urlShemeRegex>
|
||||
@@ -35,20 +21,6 @@
|
||||
</requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- SoundCloud Settings -->
|
||||
<provider name="SoundCloud" type="Umbraco.Web.Media.EmbedProviders.OEmbedRich, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[soundcloud\.com/]]></urlShemeRegex>
|
||||
<apiEndpoint><![CDATA[http://soundcloud.com/oembed]]></apiEndpoint>
|
||||
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web"></requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- StreamDotUmbracoDotCom -->
|
||||
<provider name="StreamDotUmbracoDotCom" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[stream\.umbraco\.org/]]></urlShemeRegex>
|
||||
<apiEndpoint><![CDATA[http://stream.umbraco.org/oembed]]></apiEndpoint>
|
||||
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web"></requestParams>
|
||||
</provider>
|
||||
|
||||
<!-- Daily Motion -->
|
||||
<provider name="DailyMotion" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
|
||||
<urlShemeRegex><![CDATA[dailymotion\.com/]]></urlShemeRegex>
|
||||
|
||||
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