File tree Expand file tree Collapse file tree 2 files changed +33
-23
lines changed Expand file tree Collapse file tree 2 files changed +33
-23
lines changed Original file line number Diff line number Diff line change 4
4
:to =" videoContainerRef"
5
5
:disabled =" !videoContainerRef"
6
6
defer >
7
- <Component
8
- :is =" mediaElementType"
9
- v-show =" mediaElementType === 'video' && videoContainerRef"
10
- ref =" mediaElementRef"
11
- :poster =" String(posterUrl)"
12
- autoplay
13
- crossorigin
14
- playsinline
15
- :loop =" playbackManager.isRepeatingOnce"
16
- :class =" { 'uno-object-fill': playerElement.isStretched.value }"
17
- @loadeddata =" onLoadedData" >
18
- <track
19
- v-for =" sub in playbackManager.currentItemVttParsedSubtitleTracks"
20
- :key =" `${playbackManager.currentSourceUrl}-${sub.srcIndex}`"
21
- kind =" subtitles"
22
- :label =" sub.label"
23
- :srclang =" sub.srcLang"
24
- :src =" sub.src" >
25
- </Component >
26
- <SubtitleTrack
27
- v-if =" subtitleSettings.state.enabled && playerElement.currentExternalSubtitleTrack?.parsed !== undefined" />
7
+ <div class =" uno-my-auto" >
8
+ <Component
9
+ :is =" mediaElementType"
10
+ v-show =" mediaElementType === 'video' && videoContainerRef"
11
+ ref =" mediaElementRef"
12
+ :poster =" String(posterUrl)"
13
+ autoplay
14
+ crossorigin
15
+ playsinline
16
+ :loop =" playbackManager.isRepeatingOnce"
17
+ :class =" { 'uno-object-fill': playerElement.isStretched.value, 'uno-max-h-100vh': true}"
18
+ @loadeddata =" onLoadedData" >
19
+ <track
20
+ v-for =" sub in playbackManager.currentItemVttParsedSubtitleTracks"
21
+ :key =" `${playbackManager.currentSourceUrl}-${sub.srcIndex}`"
22
+ kind =" subtitles"
23
+ :label =" sub.label"
24
+ :srclang =" sub.srcLang"
25
+ :src =" sub.src" >
26
+ </Component >
27
+ <SubtitleTrack
28
+ v-if =" subtitleSettings.state.enabled && playerElement.currentExternalSubtitleTrack?.parsed !== undefined" />
29
+ </div >
28
30
</Teleport >
29
31
</template >
30
32
</template >
Original file line number Diff line number Diff line change @@ -124,13 +124,21 @@ class PlayerElementStore extends CommonStore<PlayerElementState> {
124
124
&& mediaElementRef . value
125
125
&& mediaElementRef . value instanceof HTMLVideoElement
126
126
) {
127
+ const hasAttachedFonts = ! isNil ( attachedFonts ) && attachedFonts . length !== 0 ;
128
+
127
129
this . _jassub = new JASSUB ( {
128
130
video : mediaElementRef . value ,
129
131
subUrl : trackSrc ,
130
- fonts : attachedFonts ,
132
+ ...( hasAttachedFonts
133
+ ? {
134
+ fonts : attachedFonts
135
+ }
136
+ : {
137
+ useLocalFonts : true
138
+ } ) ,
139
+ fallbackFont : DEFAULT_TYPOGRAPHY ,
131
140
workerUrl : jassubWorker ,
132
141
wasmUrl : jassubWasmUrl ,
133
- fallbackFont : DEFAULT_TYPOGRAPHY ,
134
142
// Both parameters needed for subs to work on iOS
135
143
prescaleFactor : 0.8 ,
136
144
onDemandRender : false ,
You can’t perform that action at this time.
0 commit comments