From 897b53775a76c1a4bcd497112d87ad1a2d0ba9df Mon Sep 17 00:00:00 2001 From: hezaichang Date: Sun, 14 Jun 2020 16:44:07 +0800 Subject: [PATCH 1/2] Update x5VideoPlayerType --- __tests__/chimee/video-attr.js | 8 ++++---- demo/playsinline/index.js | 2 +- lib/index.browser.js | 16 ++++++++-------- lib/index.esm.js | 16 ++++++++-------- lib/index.js | 6 +++--- package.json | 5 ++++- src/config/video.js | 4 ++-- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/__tests__/chimee/video-attr.js b/__tests__/chimee/video-attr.js index b2b4795a..9a7a826d 100644 --- a/__tests__/chimee/video-attr.js +++ b/__tests__/chimee/video-attr.js @@ -272,9 +272,9 @@ describe('chimee video attributes', () => { test('x5VideoPlayerType', () => { expect(player.x5VideoPlayerType).toBe(); expect(getAttr(videoElement, 'x5-video-player-type')).toBe(null); - player.x5VideoPlayerType = 'h5'; - expect(player.x5VideoPlayerType).toBe('h5'); - expect(getAttr(videoElement, 'x5-video-player-type')).toBe('h5'); + player.x5VideoPlayerType = 'h5-page'; + expect(player.x5VideoPlayerType).toBe('h5-page'); + expect(getAttr(videoElement, 'x5-video-player-type')).toBe('h5-page'); player.x5VideoPlayerType = false; expect(player.x5VideoPlayerType).toBe(); expect(getAttr(videoElement, 'x5-video-player-type')).toBe(null); @@ -284,7 +284,7 @@ describe('chimee video attributes', () => { expect(player.x5VideoPlayerType).toBe(); expect(getAttr(videoElement, 'x5-video-player-type')).toBe(null); player.__dispatcher.videoConfigReady = false; - player.x5VideoPlayerType = 'h5'; + player.x5VideoPlayerType = 'h5-page'; expect(player.x5VideoPlayerType).toBe(); expect(getAttr(videoElement, 'x5-video-player-type')).toBe(null); }); diff --git a/demo/playsinline/index.js b/demo/playsinline/index.js index 1ef582cc..5868f2e2 100644 --- a/demo/playsinline/index.js +++ b/demo/playsinline/index.js @@ -7,7 +7,7 @@ const player = new Chimee({ playsInline: true, preload: 'auto', x5VideoPlayerFullscreen: true, - x5VideoPlayerType: 'h5', + x5VideoPlayerType: 'h5-page', x5VideoOrientation: 'landscape', xWebkitAirplay: true, muted: true, diff --git a/lib/index.browser.js b/lib/index.browser.js index 9c19ac22..83b28c49 100644 --- a/lib/index.browser.js +++ b/lib/index.browser.js @@ -3144,7 +3144,7 @@ /** * equal to console.error, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3168,7 +3168,7 @@ } /** * equal to console.info, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3198,7 +3198,7 @@ } /** * equal to console.warn, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3212,7 +3212,7 @@ } /** * equal to console.debug, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3226,7 +3226,7 @@ } /** * equal to console.verbose, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -7784,12 +7784,12 @@ x5VideoPlayerType: [accessor({ set: function set(value) { if (!this.dispatcher.videoConfigReady) return value; - var val = value === 'h5' ? 'h5' : undefined; + var val = value === 'h5-page' ? 'h5-page' : undefined; this.dom.setAttr('video', 'x5-video-player-type', val); return value; }, get: function get(value) { - return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5' : undefined); + return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5-page' : undefined); } })], xWebkitAirplay: [accessor({ @@ -11054,7 +11054,7 @@ if (isObject(pluginConfig)) { pluginConfig.id = id; } - var plugin = isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line + var plugin = isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line : new Plugin(pluginConfig, this, pluginOption); this.plugins[id] = plugin; _Object$defineProperty(this.vm, id, { diff --git a/lib/index.esm.js b/lib/index.esm.js index 9da96acd..38053a2f 100644 --- a/lib/index.esm.js +++ b/lib/index.esm.js @@ -3138,7 +3138,7 @@ var Log = function () { /** * equal to console.error, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3162,7 +3162,7 @@ var Log = function () { } /** * equal to console.info, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3192,7 +3192,7 @@ var Log = function () { } /** * equal to console.warn, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3206,7 +3206,7 @@ var Log = function () { } /** * equal to console.debug, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -3220,7 +3220,7 @@ var Log = function () { } /** * equal to console.verbose, output `[${tag}] > {$msg}` - * @param {string} tag optional, the header of log + * @param {string} tag optional, the header of log * @param {string} msg the message */ @@ -7778,12 +7778,12 @@ var accessorMap = { x5VideoPlayerType: [accessor({ set: function set(value) { if (!this.dispatcher.videoConfigReady) return value; - var val = value === 'h5' ? 'h5' : undefined; + var val = value === 'h5-page' ? 'h5-page' : undefined; this.dom.setAttr('video', 'x5-video-player-type', val); return value; }, get: function get(value) { - return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5' : undefined); + return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5-page' : undefined); } })], xWebkitAirplay: [accessor({ @@ -11048,7 +11048,7 @@ var Dispatcher = (_dec$7 = before(convertNameIntoId), _dec2$6 = before(convertNa if (isObject(pluginConfig)) { pluginConfig.id = id; } - var plugin = isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line + var plugin = isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line : new Plugin(pluginConfig, this, pluginOption); this.plugins[id] = plugin; _Object$defineProperty(this.vm, id, { diff --git a/lib/index.js b/lib/index.js index 8d486be4..f8133bcd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -539,12 +539,12 @@ var accessorMap = { x5VideoPlayerType: [toxicDecorators.accessor({ set: function set(value) { if (!this.dispatcher.videoConfigReady) return value; - var val = value === 'h5' ? 'h5' : undefined; + var val = value === 'h5-page' ? 'h5-page' : undefined; this.dom.setAttr('video', 'x5-video-player-type', val); return value; }, get: function get(value) { - return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5' : undefined); + return this.dispatcher.videoConfigReady && value || (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5-page' : undefined); } })], xWebkitAirplay: [toxicDecorators.accessor({ @@ -3313,7 +3313,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 = if (chimeeHelper.isObject(pluginConfig)) { pluginConfig.id = id; } - var plugin = chimeeHelper.isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line + var plugin = chimeeHelper.isFunction(pluginConfig) ? new pluginConfig({ id: id }, this, pluginOption) // eslint-disable-line : new Plugin(pluginConfig, this, pluginOption); this.plugins[id] = plugin; _Object$defineProperty(this.vm, id, { diff --git a/package.json b/package.json index 15f617e0..92488048 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "toxic-decorators": "^0.3.8" }, "devDependencies": { + "babel-core": "^6.26.3", "babel-eslint": "^8.2.6", "babel-jest": "^23.4.2", "babel-plugin-dynamic-import-node": "^2.0.0", @@ -118,6 +119,8 @@ "transform": { ".*": "babel-jest" }, - "setupFiles": ["jest-canvas-mock"] + "setupFiles": [ + "jest-canvas-mock" + ] } } diff --git a/src/config/video.js b/src/config/video.js index ce859ab9..095290ed 100644 --- a/src/config/video.js +++ b/src/config/video.js @@ -221,13 +221,13 @@ const accessorMap = { accessor({ set(value) { if (!this.dispatcher.videoConfigReady) return value; - const val = value === 'h5' ? 'h5' : undefined; + const val = value === 'h5-page' ? 'h5-page' : undefined; this.dom.setAttr('video', 'x5-video-player-type', val); return value; }, get(value) { return (this.dispatcher.videoConfigReady && value) || - (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5' : undefined); + (this.dom.getAttr('video', 'x5-video-player-type') ? 'h5-page' : undefined); }, }), ], From c1d168b94e5f8e5e13495a37ec3f10c70c33b2bd Mon Sep 17 00:00:00 2001 From: hezaichang Date: Sun, 14 Jun 2020 16:52:26 +0800 Subject: [PATCH 2/2] Update eslint configuration --- .eslintrc | 5 +++-- src/dispatcher/index.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3d419efa..9f8a8c48 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,6 +21,7 @@ "sourceType": "module" }, "rules": { - "valid-jsdoc": "off" + "valid-jsdoc": "off", + "prefer-promise-reject-errors": "off" } -} \ No newline at end of file +} diff --git a/src/dispatcher/index.js b/src/dispatcher/index.js index 3f37a974..6f0cae47 100644 --- a/src/dispatcher/index.js +++ b/src/dispatcher/index.js @@ -191,7 +191,7 @@ export default class Dispatcher { pluginConfig.id = id; } const plugin = isFunction(pluginConfig) - ? new pluginConfig({id}, this, pluginOption) // eslint-disable-line + ? new pluginConfig({id}, this, pluginOption) // eslint-disable-line : new Plugin(pluginConfig, this, pluginOption); this.plugins[id] = plugin; Object.defineProperty(this.vm, id, { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy