Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai_fundub
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
ai_fundub
Commits
2c73270d
Commit
2c73270d
authored
Jul 28, 2026
by
Jeff nan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
e24a3855
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
700 additions
and
70 deletions
+700
-70
index.js
form/index.js
+7
-7
defaultData.json
play/defaultData.json
+16
-16
index.css
play/index.css
+244
-4
index.html
play/index.html
+112
-9
index.js
play/index.js
+321
-34
No files found.
form/index.js
View file @
2c73270d
...
...
@@ -28,13 +28,13 @@ document.addEventListener('DOMContentLoaded', () => {
window
.
courseware
.
getData
(
function
(
data
)
{
window
.
air
.
hideAirClassLoading
(
key
,
data
);
if
(
!
data
)
{
// 加载默认数据
$
.
getJSON
(
'
../play/defaultData.json
'
,
function
(
defaultData
)
{
initVueApp
(
defaultData
);
})
return
;
}
//
if (!data) {
//
// 加载默认数据
//
$.getJSON('../play/defaultData.json', function (defaultData) {
//
initVueApp(defaultData);
//
})
//
return;
//
}
//数据加载完,才算页面加载完成
initVueApp
(
data
);
},
key
);
...
...
play/defaultData.json
View file @
2c73270d
{
"videoUrl"
:
"https://teach.cdn.ireadabc.com/
b3be955c80a0b969a9e3166ad9f36ae2
.mp4"
,
"videoUrl"
:
"https://teach.cdn.ireadabc.com/
030999fb68d0f182ac892de8273affd9
.mp4"
,
"playbackRate"
:
1
,
"subtitlesResult"
:
{
"assUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
.ass"
,
"srtUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
.srt"
,
"vttUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
.vtt"
,
"audioUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_audio.wav"
,
"videoUrl"
:
"https://teach.cdn.ireadabc.com/
b3be955c80a0b969a9e3166ad9f36ae2
.mp4"
,
"chineseAssUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_cn.ass"
,
"chineseSrtUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_cn.srt"
,
"chineseVttUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_cn.vtt"
,
"outputVideoUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_with_bilingual_subtitles.mp4"
,
"bilingualAssUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_bilingual.ass"
,
"subtitleJsonUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2_subtitle
.json"
,
"translatedJsonUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2_translated
.json"
"assUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
.ass"
,
"srtUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
.srt"
,
"vttUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
.vtt"
,
"audioUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9
_audio.wav"
,
"videoUrl"
:
"https://teach.cdn.ireadabc.com/
030999fb68d0f182ac892de8273affd9
.mp4"
,
"chineseAssUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
_cn.ass"
,
"chineseSrtUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
_cn.srt"
,
"chineseVttUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
_cn.vtt"
,
"outputVideoUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9
_with_bilingual_subtitles.mp4"
,
"bilingualAssUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_gmsh
_bilingual.ass"
,
"subtitleJsonUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_subtitle_gmsh
.json"
,
"translatedJsonUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9_translated_gmsh
.json"
},
"vocalResult"
:
{
"noAudioUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_no_audio.mp4"
,
"onlyVocalUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_only_vocal.mp4"
,
"removeVocalUrl"
:
"http
://teach.cdn.ireadabc.com/b3be955c80a0b969a9e3166ad9f36ae2
_remove_vocal.mp4"
"noAudioUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9
_no_audio.mp4"
,
"onlyVocalUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9
_only_vocal.mp4"
,
"removeVocalUrl"
:
"http
s://teach.cdn.ireadabc.com/030999fb68d0f182ac892de8273affd9
_remove_vocal.mp4"
}
}
\ No newline at end of file
play/index.css
View file @
2c73270d
:root
{
--bg-0
:
#10221c
;
--bg-1
:
#1a342b
;
--ink
:
#f3f0e8
;
--ink-dim
:
rgba
(
243
,
240
,
232
,
0.68
);
--accent
:
#d9a441
;
--accent-soft
:
rgba
(
217
,
164
,
65
,
0.18
);
--line
:
rgba
(
243
,
240
,
232
,
0.14
);
--panel
:
rgba
(
10
,
24
,
20
,
0.55
);
--shadow
:
0
24px
80px
rgba
(
0
,
0
,
0
,
0.35
);
--font-display
:
"Sora"
,
"Instrument Sans"
,
sans-serif
;
--font-body
:
"Instrument Sans"
,
"PingFang SC"
,
"Helvetica Neue"
,
sans-serif
;
}
*
{
box-sizing
:
border-box
;
}
html
,
body
{
background
:
#fff
;
margin
:
0
;
min-height
:
100%
;
background
:
radial-gradient
(
1200px
700px
at
15%
-10%
,
rgba
(
217
,
164
,
65
,
0.16
),
transparent
55%
),
radial-gradient
(
900px
600px
at
90%
10%
,
rgba
(
72
,
140
,
118
,
0.22
),
transparent
50%
),
linear-gradient
(
160deg
,
var
(
--bg-0
),
var
(
--bg-1
)
55%
,
#0c1814
);
color
:
var
(
--ink
);
font-family
:
var
(
--font-body
);
}
[
v-cloak
]
{
display
:
none
;
}
.stage
{
position
:
relative
;
min-height
:
100vh
;
padding
:
clamp
(
20px
,
4vw
,
40px
);
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
opacity
:
0
;
transform
:
translateY
(
12px
);
transition
:
opacity
0.55s
ease
,
transform
0.55s
ease
;
}
.stage.ready
{
opacity
:
1
;
transform
:
translateY
(
0
);
}
.stage__glow
{
position
:
fixed
;
inset
:
auto
auto
-20%
50%
;
width
:
70vw
;
height
:
40vh
;
transform
:
translateX
(
-50%
);
background
:
radial-gradient
(
circle
,
rgba
(
217
,
164
,
65
,
0.12
),
transparent
70%
);
pointer-events
:
none
;
animation
:
glowPulse
6s
ease-in-out
infinite
;
}
@keyframes
glowPulse
{
0
%,
100
%
{
opacity
:
0.45
;
transform
:
translateX
(
-50%
)
scale
(
1
);
}
50
%
{
opacity
:
0.8
;
transform
:
translateX
(
-50%
)
scale
(
1.08
);
}
}
.brand
{
width
:
min
(
960px
,
100%
);
margin-bottom
:
18px
;
animation
:
riseIn
0.7s
ease
both
;
}
.brand__mark
{
font-family
:
var
(
--font-display
);
font-size
:
clamp
(
28px
,
5vw
,
42px
);
font-weight
:
700
;
letter-spacing
:
-0.03em
;
line-height
:
1.1
;
}
.brand__tag
{
margin
:
6px
0
0
;
color
:
var
(
--ink-dim
);
font-size
:
14px
;
letter-spacing
:
0.04em
;
}
.player
{
width
:
min
(
960px
,
100%
);
animation
:
riseIn
0.8s
ease
0.08s
both
;
}
.player__frame
{
position
:
relative
;
overflow
:
hidden
;
border-radius
:
18px
;
background
:
#000
;
box-shadow
:
var
(
--shadow
);
border
:
1px
solid
var
(
--line
);
}
.player__video
{
display
:
block
;
width
:
100%
;
max-height
:
min
(
68vh
,
540px
);
background
:
#000
;
}
/* 原生单语字幕样式;双语模式由浮层承接 */
.player__video
::cue
{
font-family
:
"Sora"
,
"Instrument Sans"
,
"PingFang SC"
,
sans-serif
;
font-size
:
20px
;
font-weight
:
600
;
color
:
#fff
;
background
:
transparent
;
text-shadow
:
0
2px
10px
rgba
(
0
,
0
,
0
,
0.75
);
}
.subtitle-overlay
{
position
:
absolute
;
left
:
50%
;
bottom
:
12%
;
transform
:
translate
(
-50%
,
8px
);
width
:
min
(
88%
,
820px
);
text-align
:
center
;
pointer-events
:
none
;
opacity
:
0
;
transition
:
opacity
0.22s
ease
,
transform
0.22s
ease
;
text-shadow
:
0
2px
10px
rgba
(
0
,
0
,
0
,
0.75
);
}
#test
{
margin
:
80px
;
}
\ No newline at end of file
.subtitle-overlay.show
{
opacity
:
1
;
transform
:
translate
(
-50%
,
0
);
}
.subtitle-overlay__en
{
font-family
:
var
(
--font-display
);
font-size
:
clamp
(
16px
,
2.4vw
,
24px
);
font-weight
:
600
;
line-height
:
1.35
;
color
:
#fff
;
margin-bottom
:
4px
;
}
.subtitle-overlay__zh
{
font-size
:
clamp
(
14px
,
2vw
,
20px
);
font-weight
:
500
;
line-height
:
1.4
;
color
:
#f6e7c2
;
}
.controls
{
margin-top
:
16px
;
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
14px
20px
;
padding
:
14px
16px
;
border-radius
:
14px
;
background
:
var
(
--panel
);
border
:
1px
solid
var
(
--line
);
backdrop-filter
:
blur
(
10px
);
}
.controls__group
{
display
:
flex
;
align-items
:
center
;
gap
:
10px
;
flex-wrap
:
wrap
;
}
.controls__label
{
color
:
var
(
--ink-dim
);
font-size
:
12px
;
letter-spacing
:
0.08em
;
text-transform
:
uppercase
;
min-width
:
2.5em
;
}
.seg
{
display
:
inline-flex
;
flex-wrap
:
wrap
;
gap
:
6px
;
}
.seg__btn
{
appearance
:
none
;
border
:
1px
solid
var
(
--line
);
background
:
transparent
;
color
:
var
(
--ink
);
font-family
:
var
(
--font-body
);
font-size
:
13px
;
font-weight
:
500
;
padding
:
7px
12px
;
border-radius
:
999px
;
cursor
:
pointer
;
transition
:
background
0.2s
ease
,
border-color
0.2s
ease
,
color
0.2s
ease
,
transform
0.15s
ease
;
}
.seg__btn
:hover:not
(
:disabled
)
{
border-color
:
rgba
(
217
,
164
,
65
,
0.55
);
transform
:
translateY
(
-1px
);
}
.seg__btn.active
{
background
:
var
(
--accent-soft
);
border-color
:
var
(
--accent
);
color
:
#ffe8b0
;
}
.seg__btn
:disabled
{
opacity
:
0.35
;
cursor
:
not-allowed
;
}
.empty
{
width
:
min
(
960px
,
100%
);
margin-top
:
40px
;
color
:
var
(
--ink-dim
);
font-size
:
15px
;
animation
:
riseIn
0.6s
ease
both
;
}
@keyframes
riseIn
{
from
{
opacity
:
0
;
transform
:
translateY
(
14px
);
}
to
{
opacity
:
1
;
transform
:
translateY
(
0
);
}
}
@media
(
max-width
:
640px
)
{
.controls
{
padding
:
12px
;
}
.controls__group
{
width
:
100%
;
}
.subtitle-overlay
{
bottom
:
14%
;
}
}
play/index.html
View file @
2c73270d
<!DOCTYPE html>
<html
lang=
"
en
"
>
<html
lang=
"
zh-CN
"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
h5-template-generator
</title>
<link
href=
"./index.css"
rel=
"stylesheet"
>
<title>
AI Fundub Player
</title>
<link
rel=
"preconnect"
href=
"https://fonts.googleapis.com"
>
<link
rel=
"preconnect"
href=
"https://fonts.gstatic.com"
crossorigin
>
<link
href=
"https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap"
rel=
"stylesheet"
>
<link
href=
"./index.css"
rel=
"stylesheet"
>
<script
type=
"text/javascript"
src=
"//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/jquery-1.12.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
<script
type=
"text/javascript"
src=
"//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/vue.min.js"
></script>
<!-- 引入样式 -->
<link
href=
"//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/element-ui/theme-chalk/index.css"
rel=
"stylesheet"
>
<!-- 引入组件库 -->
<script
src=
"//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/element-ui/index.js"
></script>
</head>
<body>
<h1
id=
"test"
></h1>
</body>
<script
src=
"./index.js"
></script>
</html>
\ No newline at end of file
<div
id=
"app"
v-cloak
>
<div
class=
"stage"
:class=
"{ ready: ready }"
>
<div
class=
"stage__glow"
aria-hidden=
"true"
></div>
<header
class=
"brand"
>
<div
class=
"brand__mark"
>
AI Fundub
</div>
<p
class=
"brand__tag"
>
字幕同步播放
</p>
</header>
<main
class=
"player"
v-if=
"videoSrc"
>
<div
class=
"player__frame"
>
<video
ref=
"video"
class=
"player__video"
:src=
"videoSrc"
:playbackRate=
"playbackRate"
controls
playsinline
crossorigin=
"anonymous"
@
loadedmetadata=
"onVideoReady"
@
ratechange=
"onRateChange"
>
<track
v-if=
"tracks.en"
kind=
"subtitles"
label=
"English"
srclang=
"en"
:src=
"tracks.en"
>
<track
v-if=
"tracks.zh"
kind=
"subtitles"
label=
"中文"
srclang=
"zh"
:src=
"tracks.zh"
>
</video>
<div
class=
"subtitle-overlay"
:class=
"{ show: subtitleMode === 'bilingual' && sourceMode === 'soft' && (activeEn || activeZh) }"
aria-live=
"polite"
>
<div
v-if=
"activeEn"
class=
"subtitle-overlay__en"
>
{{ activeEn }}
</div>
<div
v-if=
"activeZh"
class=
"subtitle-overlay__zh"
>
{{ activeZh }}
</div>
</div>
</div>
<div
class=
"controls"
>
<div
class=
"controls__group"
>
<span
class=
"controls__label"
>
字幕
</span>
<div
class=
"seg"
>
<button
v-for=
"opt in subtitleModes"
:key=
"opt.value"
type=
"button"
class=
"seg__btn"
:class=
"{ active: subtitleMode === opt.value }"
:disabled=
"opt.disabled"
@
click=
"setSubtitleMode(opt.value)"
>
{{ opt.label }}
</button>
</div>
</div>
<div
class=
"controls__group"
>
<span
class=
"controls__label"
>
语速
</span>
<div
class=
"seg"
>
<button
v-for=
"rate in rateOptions"
:key=
"rate"
type=
"button"
class=
"seg__btn"
:class=
"{ active: Number(playbackRate) === rate }"
@
click=
"setPlaybackRate(rate)"
>
{{ rate }}x
</button>
</div>
</div>
<div
class=
"controls__group"
v-if=
"hasHardSubVideo"
>
<span
class=
"controls__label"
>
片源
</span>
<div
class=
"seg"
>
<button
type=
"button"
class=
"seg__btn"
:class=
"{ active: sourceMode === 'soft' }"
@
click=
"setSourceMode('soft')"
>
原片+软字幕
</button>
<button
type=
"button"
class=
"seg__btn"
:class=
"{ active: sourceMode === 'hard' }"
@
click=
"setSourceMode('hard')"
>
烧录字幕片
</button>
</div>
</div>
</div>
</main>
<div
v-else
class=
"empty"
>
<p>
暂无视频数据,请先在配置页生成字幕。
</p>
</div>
</div>
</div>
<script
src=
"./index.js"
></script>
</body>
</html>
play/index.js
View file @
2c73270d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment