mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -08:00
add danmuku maxWidth
This commit is contained in:
1 parent
93a517eaf8
commit
2cb73141fb
54 files changed
+211
-169
No files matched your search
@@ -80,11 +80,15 @@ var art = new Artplayer({
|
||||
fontSize: 25, // Font size, supports numbers and percentages
|
||||
color: '#FFFFFF', // Default font color
|
||||
mode: 0, // Default mode, 0-scroll, 1-still
|
||||
margin: ['2%', 60], // Barrage top and bottom margins, supports numbers and percentages
|
||||
margin: [10, '25%'], // Barrage top and bottom margins, supports numbers and percentages
|
||||
antiOverlap: true, // Whether to prevent overlapping
|
||||
useWorker: true, // whether to use web workers
|
||||
synchronousPlayback: false, // Whether to sync to playback speed
|
||||
filter: (danmu) => danmu.text.length < 50, // Barrage filter function
|
||||
lockTime: 5, // Input box lock time
|
||||
maxLength: 100, // The maximum number of words that can be input can be input box
|
||||
minWidth: 150, // At the at least width of the input box
|
||||
maxWidth: 400, // Maximum width in the input box
|
||||
// mount: document.querySelector('.your-danmu-input'), // Custom barrage input box position
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -80,11 +80,15 @@ var art = new Artplayer({
|
||||
fontSize: 25, // 字体大小,支持数字和百分比
|
||||
color: '#FFFFFF', // 默认字体颜色
|
||||
mode: 0, // 默认模式,0-滚动,1-静止
|
||||
margin: ['2%', 60], // 弹幕上下边距,支持数字和百分比
|
||||
margin: [10, '25%'], // 弹幕上下边距,支持数字和百分比
|
||||
antiOverlap: true, // 是否防重叠
|
||||
useWorker: true, // 是否使用 web worker
|
||||
synchronousPlayback: false, // 是否同步到播放速度
|
||||
filter: (danmu) => danmu.text.length < 50, // 弹幕过滤函数
|
||||
lockTime: 5, // 输入框锁定时间,单位秒,范围在[1 ~ 60]
|
||||
maxLength: 100, // 输入框最大可输入的字数,范围在[0 ~ 500]
|
||||
minWidth: 150, // 输入框最少宽度,范围在[0 ~ 500],超出则隐藏,填 0 则永不隐藏
|
||||
maxWidth: 400, // 输入框最大宽度,范围在[0 ~ Infinity],填 0 则 100% 宽度
|
||||
|
||||
// mount 选项用于自定义弹幕输入框的挂载位置,默认挂载在播放器控制栏中间
|
||||
// 但在移动端下控制栏宽度不足,所以最好自己决定弹幕输入框放在那里
|
||||
|
||||
Reference in new issue
Block a user