src/ZKEACMS.SectionWidget/Views/SectionContentVideo/Play.cshtml
(完整代码) 1KB@using System.Text.RegularExpressions
@using ZKEACMS.SectionWidget.Models
@model SectionContent
@{
Layout = Layouts.ClientPopUp;
SectionContentVideo video = Model as SectionContentVideo;
if (video == null)
{
return;
}
ViewBag.Title = video.VideoTitle;
Style.Reqiured("Section").AtFoot();
}
<div class="pop-video">
@if (video.Url.IsNotNullAndWhiteSpace())
{
<video id="video-player" controls="controls"
autoplay="autoplay"
playsinline
name="media"
src="@Url.Content(video.Url)"
style="width:@(video.Width.HasValue?video.Width+"px":"auto");height:@(video.Height.HasValue?video.Height+"px":"auto")">
Your brower does not support playing video.
</video>
}
else if (video.Code.IsNotNullAndWhiteSpace())
{
video.Code = Regex.Replace(video.Code, @"("")?width("")?=("")?(\d+)("")?", "width=\"" + (video.Width ?? 798) + "\"");
video.Code = Regex.Replace(video.Code, @"("")?width("")?:("")?(\d+)("")?", "width:" + (video.Width ?? 798));
video.Code = Regex.Replace(video.Code, @"("")?height("")?=("")?(\d+)("")?", "height=" + (video.Height ?? 500));
video.Code = Regex.Replace(video.Code, @"("")?height("")?:("")?(\d+)("")?", "height:" + (video.Height ?? 500));
@Html.Raw(video.Code)
}
</div>
@using (Script.AtFoot())
{
<script type="text/javascript">
$(function () {
document.getElementById("video-player").play();
});
</script>
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。