current user transfer html use template func

This commit is contained in:
kenneth
2023-12-05 07:06:05 +00:00
parent 26ee393549
commit a6338a36ea
11 changed files with 68 additions and 114 deletions

View File

@@ -21,9 +21,9 @@
HLS流媒体
</a>
<ul class="flex oauth">
{{if .Authorize.ID}}
{{if currentUser}}
<li style="font-size: 12px;">
欢迎您: {{.Authorize.Name}}
欢迎您: {{ currentUser.Name }}
</li>
<li style="font-size: 12px;">
<a href="/me/videos">我的视频</a>

View File

@@ -3,7 +3,7 @@
<div class="main">
<h3 style="margin-top: 20px;margin-bottom: 10px;">视频列表</h3>
<div class="video-list">
{{range .Videos}}
{{range .}}
<div class="card">
<img src="{{.Images}}" class="card-img-top" alt="{{.Title}}">
<div class="card-body">

View File

@@ -1,7 +1,7 @@
{{template "header" .}}
<div class="container-fluid flex justify-content">
<div class="main">
{{if eq .Video.Status 200}}
{{if eq .Status 200}}
<h6 style="margin-top: 20px;margin-bottom: 10px;">正在播放
<svg class="icon" viewBox="0 0 1024 1024" width="15" height="21">
<path
@@ -10,7 +10,7 @@
<path
d="M864.696118 992.000352c0-7.399919-2.599971-14.899836-7.799914-20.89977l-360.796029-416.99541c-20.999769-23.999736-20.999769-60.299336 0-84.299073l0.099999-0.099999L856.896204 52.910688c11.599872-13.399853 10.099889-33.59963-3.299964-45.099504-13.399853-11.599872-33.59963-10.099889-45.099503 3.299964L447.900705 427.806562c-20.399775 23.299744-31.599652 53.199414-31.599652 84.199073s11.199877 60.89933 31.599652 84.199073l360.596032 416.695414c11.599872 13.399853 31.79965 14.799837 45.099503 3.299964 7.399919-6.299931 11.099878-15.199833 11.099878-24.199734z"
p-id="6426"></path>
</svg>{{.Video.Title}}<svg class="icon" viewBox="0 0 1024 1024" width="15" height="21">
</svg>{{.Title}}<svg class="icon" viewBox="0 0 1024 1024" width="15" height="21">
<path
d="M416.301053 992.000352c0-7.399919 2.599971-14.899836 7.799914-20.89977l360.79603-416.895412c20.999769-23.999736 20.999769-60.299336 0-84.299072l-0.099999-0.099999L424.100967 52.910688c-11.599872-13.399853-10.099889-33.59963 3.299964-45.099504 13.399853-11.599872 33.59963-10.099889 45.099504 3.299964l360.596031 416.695414c20.399775 23.299744 31.599652 53.199414 31.599652 84.199073s-11.199877 60.89933-31.599652 84.199073l-360.596031 416.695414c-11.599872 13.399853-31.79965 14.799837-45.099504 3.299964-7.399919-6.299931-11.099878-15.199833-11.099878-24.199734z"
p-id="6274"></path>
@@ -46,14 +46,14 @@
if (Hls.isSupported()) {
console.log("supported");
var hls = new Hls();
hls.loadSource('{{.Video.PlayLink}}');
hls.loadSource('{{.PlayLink}}');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function () {
//video.play();
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
console.log("no supported");
video.src = '{{.Video.PlayLink}}';
video.src = '{{.PlayLink}}';
video.addEventListener('loadedmetadata', function () {
//video.play();
});

View File

@@ -6,7 +6,7 @@
<a href="/me/videos/update" class="btn btn-primary">添加</a>
</div>
<div class="video-list">
{{range .Videos}}
{{range .}}
<div class="card">
<img src="{{.Images}}" class="card-img-top" alt="{{.Title}}">
<div class="card-body">