remove bilingual

This commit is contained in:
Harvey committed 2022-03-10 09:48:32 +08:00
1 parent 5defc28505
commit b4500e701f
63 files changed
+362 -335

No files matched your search

@@ -262,7 +262,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
@@ -296,7 +295,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
@@ -327,7 +325,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: 'red',
'font-size': '30px',
@@ -340,7 +337,6 @@ art.on('ready', () => {
setTimeout(() => {
art.subtitle.switch('/assets/sample/subtitle.srt?t=1', {
name: 'The new subtitle',
bilingual: false,
style: {
color: 'green',
'font-size': '24px',
@@ -863,13 +863,12 @@ var art = new Artplayer({
Set the subtitles of the video, support subtitles format: `vtt`、`srt`、`ass`
| Property | Type | Description |
| ----------- | --------- | ------------------------------------------------------ |
| `url` | `String` | Subtitle url |
| `type` | `String` | Subtitle type: `vtt`, `srt`, `ass` |
| `style` | `Object` | Subtitle style |
| `encoding` | `String` | Subtitle encoding, default `utf-8` |
| `bilingual` | `Boolean` | Whether the double subtitle style is divided by a wrap |
| Property | Type | Description |
| ---------- | -------- | ---------------------------------- |
| `url` | `String` | Subtitle url |
| `type` | `String` | Subtitle type: `vtt`, `srt`, `ass` |
| `style` | `Object` | Subtitle style |
| `encoding` | `String` | Subtitle encoding, default `utf-8` |
<div className="run-code">▶ Run Code</div>
@@ -881,7 +880,6 @@ var art = new Artplayer({
url: '/assets/sample/subtitle.srt',
type: 'srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
@@ -262,7 +262,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
@@ -296,7 +295,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
@@ -327,7 +325,6 @@ var art = new Artplayer({
subtitle: {
url: '/assets/sample/subtitle.srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: 'red',
'font-size': '30px',
@@ -340,7 +337,6 @@ art.on('ready', () => {
setTimeout(() => {
art.subtitle.switch('/assets/sample/subtitle.srt?t=1', {
name: 'The new subtitle',
bilingual: false,
style: {
color: 'green',
'font-size': '24px',
@@ -864,13 +864,12 @@ var art = new Artplayer({
设置视频的字幕,支持字幕格式:`vtt`、`srt`、`ass`
| 属性 | 类型 | 描述 |
| ----------- | --------- | ---------------------------------- |
| `url` | `String` | 字幕地址 |
| `type` | `String` | 字幕类型,可选 `vtt`、`srt`、`ass` |
| `style` | `Object` | 字幕样式 |
| `encoding` | `String` | 字幕编码,默认 `utf-8` |
| `bilingual` | `Boolean` | 是否双字幕样式,通过换行区分 |
| 属性 | 类型 | 描述 |
| ---------- | -------- | ---------------------------------- |
| `url` | `String` | 字幕地址 |
| `type` | `String` | 字幕类型,可选 `vtt`、`srt`、`ass` |
| `style` | `Object` | 字幕样式 |
| `encoding` | `String` | 字幕编码,默认 `utf-8` |
<div className="run-code">▶ Run Code</div>
@@ -882,7 +881,6 @@ var art = new Artplayer({
url: '/assets/sample/subtitle.srt',
type: 'srt',
encoding: 'utf-8',
bilingual: true,
style: {
color: '#03A9F4',
'font-size': '30px',
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer.js v4.3.1
* artplayer.js v4.3.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}('.art-video-player{zoom:1;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-high-contrast-adjust:none;background-color:#000;color:#eee;direction:ltr;display:flex;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:14px;height:100%;line-height:1.3;margin:0 auto;outline:0;position:relative;text-align:left;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:20}.art-video-player *{box-sizing:border-box;margin:0;padding:0}.art-video-player ::-webkit-scrollbar{height:5px;width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{align-items:center;display:inline-flex;justify-content:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}.art-video-player .art-video{background-color:#000;cursor:pointer;z-index:10}.art-video-player .art-poster,.art-video-player .art-video{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.art-video-player .art-poster{background-position:50%;background-repeat:no-repeat;background-size:cover;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:11}.art-video-player .art-subtitle{bottom:10px;color:#fff;display:none;font-size:20px;padding:0 20px;pointer-events:none;position:absolute;text-align:center;text-shadow:.5px .5px .5px rgba(0,0,0,.5);width:100%;z-index:20}.art-video-player .art-subtitle p{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;line-height:1.2;margin:5px 0 0;word-break:break-all}.art-video-player .art-bilingual p:nth-child(n+2){transform:scale(.6);transform-origin:center top}.art-video-player.art-subtitle-show .art-subtitle{display:block}.art-video-player.art-control-show .art-subtitle{bottom:50px}.art-video-player .art-danmuku{z-index:30}.art-video-player .art-danmuku,.art-video-player .art-layers{bottom:0;height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%}.art-video-player .art-layers{display:none;z-index:40}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}.art-video-player .art-mask{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:50}.art-video-player .art-mask .art-state{align-items:center;bottom:65px;display:flex;height:60px;justify-content:center;opacity:.6;position:absolute;right:30px;width:60px}.art-video-player.art-mask-show .art-mask{display:flex}.art-video-player .art-loadingLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}('.art-video-player{zoom:1;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-high-contrast-adjust:none;background-color:#000;color:#eee;direction:ltr;display:flex;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:14px;height:100%;line-height:1.3;margin:0 auto;outline:0;position:relative;text-align:left;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:20}.art-video-player *{box-sizing:border-box;margin:0;padding:0}.art-video-player ::-webkit-scrollbar{height:5px;width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{align-items:center;display:inline-flex;justify-content:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}.art-video-player .art-video{background-color:#000;cursor:pointer;z-index:10}.art-video-player .art-poster,.art-video-player .art-video{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.art-video-player .art-poster{background-position:50%;background-repeat:no-repeat;background-size:cover;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:11}.art-video-player .art-subtitle{bottom:10px;color:#fff;display:none;font-size:20px;padding:0 20px;pointer-events:none;position:absolute;text-align:center;text-shadow:.5px .5px .5px rgba(0,0,0,.5);width:100%;z-index:20}.art-video-player .art-subtitle p{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;line-height:1.2;margin:5px 0 0;word-break:break-all}.art-video-player.art-subtitle-show .art-subtitle{display:block}.art-video-player.art-control-show .art-subtitle{bottom:50px}.art-video-player .art-danmuku{z-index:30}.art-video-player .art-danmuku,.art-video-player .art-layers{bottom:0;height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%}.art-video-player .art-layers{display:none;z-index:40}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}.art-video-player .art-mask{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:50}.art-video-player .art-mask .art-state{align-items:center;bottom:65px;display:flex;height:60px;justify-content:center;opacity:.6;position:absolute;right:30px;width:60px}.art-video-player.art-mask-show .art-mask{display:flex}.art-video-player .art-loading{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;pointer-eventsLine truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer",
"version": "4.3.1",
"version": "4.3.2",
"expose": "Artplayer",
"description": "ArtPlayer.js is a modern and full featured HTML5 video player",
"main": "dist/artplayer.js",
-1
View File
@@ -160,7 +160,6 @@ export default class Artplayer extends Emitter {
type: '',
style: {},
encoding: 'utf-8',
bilingual: false,
},
moreVideoAttr: {
controls: false,
-1
View File
@@ -100,7 +100,6 @@ export default {
type: s,
style: o,
encoding: s,
bilingual: b,
},
moreVideoAttr: o,
icons: o,
@@ -20,13 +20,6 @@
}
}
.art-bilingual {
p:nth-child(n + 2) {
transform: scale(0.6);
transform-origin: center top;
}
}
&.art-subtitle-show {
.art-subtitle {
display: block;
+1 -28
View File
@@ -1,16 +1,4 @@
import {
setStyle,
setStyles,
srtToVtt,
vttToBlob,
getExt,
assToVtt,
addClass,
escape,
removeClass,
hasClass,
errorHandle,
} from './utils';
import { setStyle, setStyles, srtToVtt, vttToBlob, getExt, assToVtt, escape, errorHandle } from './utils';
import Component from './utils/component';
import validator from 'option-validator';
import scheme from './scheme';
@@ -42,20 +30,6 @@ export default class Subtitle extends Component {
return this.textTrack.activeCues[0];
}
get bilingual() {
const { $subtitle } = this.art.template;
return hasClass($subtitle, 'art-bilingual');
}
set bilingual(val) {
const { $subtitle } = this.art.template;
if (val) {
addClass($subtitle, 'art-bilingual');
} else {
removeClass($subtitle, 'art-bilingual');
}
}
style(key, value) {
const { $subtitle } = this.art.template;
if (typeof key === 'object') {
@@ -107,7 +81,6 @@ export default class Subtitle extends Component {
}
this.style(subtitleOption.style);
this.bilingual = subtitleOption.bilingual;
errorHandle(window.fetch, 'fetch not support');
return fetch(subtitleOption.url)
-5
View File
@@ -169,11 +169,6 @@ type SubtitleOption = {
* The subtitle encoding, default utf-8
*/
encoding?: string;
/**
* Whether bilingual subtitle
*/
bilingual?: boolean;
};
type AdsOption = {