修改包管理

This commit is contained in:
Harvey Zack committed 2018-11-07 17:12:42 +08:00
1 parent c5c673ae79
commit 0aa018db6d
99 files changed
+70 -70

No files matched your search

+100
View File
@@ -0,0 +1,100 @@
import validElement from './validElement';
export default {
container: {
validator: validElement,
required: true
},
url: {
type: 'string',
required: true
},
title: 'string',
volume: 'number',
thumbnails: {
type: 'object',
child: {
url: 'string',
number: 'number',
width: 'number',
height: 'number',
column: 'number'
}
},
screenshot: 'boolean',
autoplay: 'boolean',
playbackRate: 'boolean',
aspectRatio: 'boolean',
loop: 'boolean',
type: {
type: 'string'
},
mimeCodec: 'string',
layers: {
type: 'array',
child: {
name: 'string',
index: 'number',
html: {
validator: validElement
},
style: 'object'
}
},
contextmenu: {
type: 'array',
child: {
type: 'object|function',
name: 'string',
html: {
validator: validElement
},
click: 'function'
}
},
quality: {
type: 'array',
child: {
default: 'boolean',
name: 'string',
url: 'string'
}
},
loading: validElement,
play: validElement,
theme: 'string',
hotkey: 'boolean',
pip: 'boolean',
mutex: 'boolean',
fullscreen: 'boolean',
fullscreenWeb: 'boolean',
subtitle: {
type: 'object',
child: {
url: 'string',
style: 'object'
}
},
controls: {
type: 'array',
child: {
option: {
type: 'object',
child: {
disable: 'boolean',
position: 'boolean',
index: 'number'
}
}
}
},
highlight: {
type: 'array',
child: {
time: 'number',
text: 'string'
}
},
moreVideoAttr: 'object',
lang: 'string'
};
@@ -0,0 +1,17 @@
import { ArtPlayerError } from '../utils';
export default function validElement(paths, value, type) {
if (type === 'string') {
if (value.trim() === '') {
throw new ArtPlayerError(`${paths.join('.')} can not be empty'`);
} else {
return true;
}
}
if (value instanceof Element) {
return true;
}
throw new ArtPlayerError(`${paths.join('.')} require 'string' or 'Element' type, but got '${type}'`);
}