public YoutubeBlockResponse(YoutubeBlock youtubeBlock, [CanBeNull] Annotation annotation, [CanBeNull] string googleDocLink) { Hide = youtubeBlock.Hide; VideoId = youtubeBlock.VideoId; Annotation = annotation; GoogleDocLink = googleDocLink; }
private async Task <IEnumerable <IApiSlideBlock> > RenderBlock(YoutubeBlock yb, SlideRenderContext context) { var annotation = await videoAnnotationsClient.GetVideoAnnotations(context.VideoAnnotationsGoogleDoc, yb.VideoId); var googleDocLink = string.IsNullOrEmpty(context.VideoAnnotationsGoogleDoc) ? null : "https://docs.google.com/document/d/" + context.VideoAnnotationsGoogleDoc; var response = new YoutubeBlockResponse(yb, annotation, googleDocLink); return(new [] { response }); }
public static System.Web.WebPages.HelperResult Block(YoutubeBlock block, BlockRenderContext context) { return(new System.Web.WebPages.HelperResult(__razor_helper_writer => { WebViewPage.WriteLiteralTo(@__razor_helper_writer, "\t<div class=\"video-container\">\r\n\t\t<iframe class=\"embedded-video\" width=\"864\" heig" + "ht=\"480\" src=\"https://www.youtube.com/embed/"); WebViewPage.WriteTo(@__razor_helper_writer, block.VideoId); WebViewPage.WriteLiteralTo(@__razor_helper_writer, "\" allowfullscreen></iframe>\r\n\t</div>\r\n"); WebViewPage.WriteLiteralTo(@__razor_helper_writer, @" <div> <a href=""javascript://"" class=""popover-trigger"" title=""Как ускорить видео?"" data-content=""Если по иконке с шестеренкой нет возможности ускорить видео, то вам нужно <a target='blank' href='http://youtube.com/html5'>вручную включить</a> использование HTML5-плеера.""> Как ускорить видео? </a> </div> "); })); }