Skip to content

Commit

Permalink
Merge branch 'feature_subtitle' into 'xgplayer-2'
Browse files Browse the repository at this point in the history
Feature subtitle [skipped]

See merge request toutiao-fe-arch/xgplayer!33
  • Loading branch information
hongqiongxing-b committed Mar 2, 2021
2 parents 75721a6 + 05be929 commit ee41506
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/xgplayer/src/skin/controls/textTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import SubTitles from 'xgplayer-subtitles'
import '../style/controls/textTrack.scss'

const defaultStyle = {
follow: true,
mode: 'st',
followBottom: 50,
fitVideo: true,
offsetBottom: 2,
baseSizeX: 49,
baseSizeY: 28,
minSize: 16,
minMobileSize: 13,
line: 'double'
follow: true, // 是否跟随控制栏调整位置
mode: 'stroke', // 字体显示模式,默认是描边
followBottom: 50, // 跟随底部控制栏的高度
fitVideo: true, //是否跟随视频自动调整字号
offsetBottom: 2, //字幕距离画面底部百分比,默认2%
baseSizeX: 49, //横屏视频适配基准字号
baseSizeY: 28, //竖屏视频适配基准字号
minSize: 16, //pc端最小字号
minMobileSize: 13, //移动端最小字号
line: 'double', //最大显示行数 single/double/three
fontColor: '#fff' // 字体颜色
}

function createSubTitle (textTrack, style = {}, defaultOpen = true) {
console.log('textTrack', textTrack)
const config = {
subTitles: textTrack,
defaultOpen: defaultOpen
Expand Down

0 comments on commit ee41506

Please sign in to comment.