public void CreateContentFromEmbed(string embed, ISmartContent content) { try { // download the video Video video = VideoProviderManager.FindVideo(embed); VideoSmartContent vsc = new VideoSmartContent(content); vsc.Initialize(video, null); if (video == null) { throw new ContentCreationException( "Unable to Parse Video Embed", "Unknown provider or incomplete embed."); } } catch (ContentCreationException) { throw; } catch (VideoPluginException ex) { throw new ContentCreationException(ex.Title, ex.Description); } catch (Exception ex) { VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex); throw new ContentCreationException(exception.Title, exception.Description); } }
public override void CreateContentFromUrl(string url, ref string title, ISmartContent content) { try { // download the video Video video = VideoProviderManager.FindVideo(url); if (video == null) { throw new ContentCreationException( Res.Get(StringId.Plugin_Video_Cannot_Parse_Url), Res.Get(StringId.Plugin_Video_Cannot_Parse_Url_Message)); } VideoSmartContent vsc = new VideoSmartContent(content); vsc.Initialize(video, null); } catch (ContentCreationException) { throw; } catch (VideoPluginException ex) { throw new ContentCreationException(ex.Title, ex.Description); } catch (Exception ex) { VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex); throw new ContentCreationException(exception.Title, exception.Description); } }