From bfcfc449aa331e5bf2a5779e7c183ee57060a9e5 Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Wed, 28 Nov 2018 19:33:49 +0800 Subject: [PATCH] docs update --- docs/docs/README.md | 16 ++++++++++++++-- docs/lab/js/mobile.js | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/docs/README.md b/docs/docs/README.md index c9dad6b31..4d6371223 100644 --- a/docs/docs/README.md +++ b/docs/docs/README.md @@ -141,13 +141,25 @@ var art = new Artplayer({ 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](/) +By default, non-whitelisted devices only set video native properties and third-party dependencies. + +[Open with mobile](https://artplayer.org/lab/mobile.html) ```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', + url: url + '/video/one-more-time-one-more-chance-480p.flv', + customType: { + flv: function(video, url) { + const flvPlayer = flvjs.createPlayer({ + type: 'flv', + url: url, + }); + flvPlayer.attachMediaElement(video); + flvPlayer.load(); + }, + }, whitelist: ['iPhone OS 9'], // whitelist: [(ua)=>{ return /iPhone OS 9/gi.test(ua); }], // whitelist: [/iPhone OS 9/gi] diff --git a/docs/lab/js/mobile.js b/docs/lab/js/mobile.js index 0af364276..a112d30ec 100644 --- a/docs/lab/js/mobile.js +++ b/docs/lab/js/mobile.js @@ -12,4 +12,7 @@ var art = new Artplayer({ flvPlayer.load(); }, }, + whitelist: ['iPhone OS 11'], + // whitelist: [(ua)=>{ return /iPhone OS 11/gi.test(ua); }], + // whitelist: [/iPhone OS 11/gi] }); \ No newline at end of file