public override string CreateRenderedViewerMarkup(Uri url, int maxWidth, int maxHeight) { string videoUrl = new BcWebClient().ResolveMinifiedUrl(url); //WORKAROUND for telligent bug videoUrl = videoUrl.Replace("&", "&"); Match match = BcRegex.Match(videoUrl); if (match.Success) { int height = 450; int width = 480; bool isHttps = !string.IsNullOrEmpty(match.Groups["https"].Value); string playerId = match.Groups["playerId"].Value; string playerKey = match.Groups["playerKey"].Value; string videoId = match.Groups["videoId"].Value; Globals.ScaleUpDown(ref width, ref height, maxWidth, maxHeight); string playerHtml = string.Format(PlayerHtmlTemplateBody, playerId, videoId, playerKey, width, height, isHttps?PLayerHtmlHttpsModifier:string.Empty); CSContext context = CSContext.Current; Page page = null; if (context.Context != null) { page = context.Context.Handler as Page; } if (page != null) { string id = "video_" + Guid.NewGuid(); var wrapper = new StringBuilder(); wrapper.Append("<script type=\"text/javascript\" src=\""); wrapper.Append( Globals.FullPath(page.ClientScript.GetWebResourceUrl(typeof(BrightcoveMediaViewer), "FourRoads.Common.TelligentCommunity.Plugins.insertmarkup.js"))); wrapper.Append("\"></script>"); wrapper.AppendFormat("<div id=\"{0}\"><noscript>{1}</noscript></div>", id, playerHtml); wrapper.Append(string.Format(PlayerHtmlTemplateHead, isHttps ? "s":string.Empty)); wrapper.Append("<script type=\"text/javascript\">\n"); wrapper.Append("cs_setInnerHtml('"); wrapper.Append(id); wrapper.Append("','"); wrapper.Append(JavaScript.Encode(playerHtml)); wrapper.Append("');"); wrapper.Append("\n</script>"); wrapper.Append(PlayerHtmlTemplateTail); return(wrapper.ToString()); } return(playerHtml); } return(string.Empty); }
public override string CreateRenderedViewerMarkup(Uri url, int maxWidth, int maxHeight) { Match match = CSRegex.DailyMotionViewerIdRegex().Match(url.OriginalString); if (!match.Success) { return(string.Empty); } int width = 420; int height = 0x14b; Globals.ScaleUpDown(ref width, ref height, maxWidth, maxHeight); string playerHtml = string.Format("<iframe source=\"{3}\" frameborder=\"0\" width=\"{1}\" height=\"{2}\" src=\"http://www.dailymotion.com/embed/video/{0}\" allowfullscreen></iframe>", Globals.EnsureHtmlEncoded(match.Groups[1].Value), width, height, HttpUtility.HtmlAttributeEncode(url.ToString())); CSContext current = CSContext.Current; Page handler = null; if (current.Context != null) { handler = current.Context.Handler as Page; } if (handler != null) { string videoId = "video_" + Guid.NewGuid().ToString(); StringBuilder embedHtml = new StringBuilder(); embedHtml.Append("<script type=\"text/javascript\" src=\""); embedHtml.Append(Globals.FullPath(handler.ClientScript.GetWebResourceUrl(typeof(DailyMotionMediaViewer), "FourRoads.Common.TelligentCommunity.Plugins.insertmarkup.js"))); embedHtml.Append("\"></script>"); embedHtml.AppendFormat("<div id=\"{0}\"><noscript>{1}</noscript></div>", videoId, playerHtml); embedHtml.Append("<script type=\"text/javascript\">\n"); embedHtml.Append("cs_setInnerHtml('"); embedHtml.Append(videoId); embedHtml.Append("','"); embedHtml.Append(JavaScript.Encode(playerHtml)); embedHtml.Append("');"); embedHtml.Append("\n</script>"); return(embedHtml.ToString()); } return(playerHtml); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, CSContext CScontext) { // global policy - assign here or on each controller app.UseCors("CorsPolicy"); app.Use(async(context, next) => { await next(); if (context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value) && !context.Request.Path.Value.StartsWith("/api/")) { context.Request.Path = "/index.html"; await next(); } }); DBInitializer.Initialize(CScontext); app.UseMvcWithDefaultRoute(); app.UseDefaultFiles(); app.UseStaticFiles(); }
public PutCustomerPayCommandHandler(CSContext context) { _context = context; }
public OrderController(CSContext context) { _context = context; }
public GetCustomerQueryHandler(CSContext context) { _context = context; }
public WishCardsController(CSContext context) { _context = context; }
public MessageController(CSContext context) { _context = context; }
public MembershipController(CSContext context) { _context = context; }
public UserController(CSContext context) { _context = context; }
public AccController(CSContext context) { _context = context; }
public SellModelsController(CSContext context) { _context = context; }
public ChatroomController(CSContext context) { _context = context; }
protected BaseService(CSContext db) { _db = db; }
public CollectionsController(CSContext context) { _context = context; }
public DeleteCustomerCommandHandler(CSContext context) { _context = context; }
public WishListsController(CSContext context) { _context = context; }
public BuyModelsController(CSContext context) { _context = context; }
public PostCustomerCommandHandler(CSContext context) { _context = context; }