添加白名单功能

This commit is contained in:
Harvey Zack committed 2018-11-28 19:26:21 +08:00
1 parent 970e7e3b89
commit 02c45caa38
11 files changed
+253 -43

No files matched your search

+20
View File
@@ -134,6 +134,26 @@ var art = new Artplayer({
});
```
## whitelist
- Type: `Array`
- Default: `[]`
The current player uses the simplest native components on mobile devices, but you can filter this feature through whitelist. `whitelist` accept `String`, `function`, and `regular` expressions, contrast information comes from `window.navigator.userAgent`
[Run Code](/)
```js
var url = 'https://blog.zhw-island.com/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
whitelist: ['iPhone OS 9'],
// whitelist: [(ua)=>{ return /iPhone OS 9/gi.test(ua); }],
// whitelist: [/iPhone OS 9/gi]
});
```
## poster
- Type: `String`