mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 10:41:20 -08:00
add more files
This commit is contained in:
1 parent
5a59096f9b
commit
19a2636ea9
12 files changed
+350
-169
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { errorHandle } from './index';
|
||||
|
||||
export default function verification(option) {
|
||||
errorHandle(option.container, '\'container\' option is required.');
|
||||
|
||||
errorHandle(option.url, '\'url\' option is required.');
|
||||
|
||||
errorHandle(
|
||||
option.container instanceof Element,
|
||||
`'container' option require 'Element' type, but got '${typeof option.container}'.`
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
typeof option.url === 'string' || Array.isArray(option.url),
|
||||
`'url' option require 'string' or 'array' type, but got '${typeof option.url}'.`
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
typeof option.poster === 'string',
|
||||
`'url' option require 'string' type, but got '${typeof option.poster}'.`
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
typeof option.volume === 'number',
|
||||
`'volume' option require 'number' type, but got '${typeof option.volume}'.`
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
typeof option.autoplay === 'boolean',
|
||||
`'autoplay' option require 'boolean' type, but got '${typeof option.autoplay}'.`
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
['none', 'metadata', 'auto'].indexOf(option.preload) > -1,
|
||||
'\'preload\' option require one of \'none、metadata、auto\'.'
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user