Skip to content

Commit

Permalink
[update] add startLoad and stopLoad as required in #70
Browse files Browse the repository at this point in the history
  • Loading branch information
toxic-johann committed Jun 1, 2019
1 parent e2edcc4 commit 02384df
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 23 deletions.
1 change: 0 additions & 1 deletion packages/chimee-kernel-hls/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ all=warn
untyped-type-import=error
sketchy-null-bool=off
[options]
unsafe.enable_getters_and_setters=true
esproposal.decorators=ignore
[strict]
3 changes: 1 addition & 2 deletions packages/chimee-kernel-hls/build/rollup.config.base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { version, name, author, license, dependencies } = require('../package.json');
const banner = `
export const banner = `
/**
* ${name} v${version}
* (c) 2017 ${author}
Expand Down Expand Up @@ -120,7 +120,6 @@ const externalRegExp = new RegExp(Object.keys(dependencies).join('|'));
export default function(mode) {
return {
input: 'src/index.js',
banner,
external(id) {
return !/min|umd|iife/.test(mode) && externalRegExp.test(id);
},
Expand Down
3 changes: 2 additions & 1 deletion packages/chimee-kernel-hls/build/rollup.config.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import base from './rollup.config.base';
import base, { banner } from './rollup.config.base';
export default Object.assign(base('common'), {
output: {
banner,
format: 'cjs',
file: 'lib/index.js',
},
Expand Down
5 changes: 3 additions & 2 deletions packages/chimee-kernel-hls/build/rollup.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import base from './rollup.config.base';
import base, { banner } from './rollup.config.base';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import replace from 'rollup-plugin-replace';
Expand All @@ -14,8 +14,9 @@ config.plugins.unshift(replace({
}));
export default Object.assign(config, {
output: {
banner,
name: camelize(name, true),
format: 'umd',
file: 'lib/index.dev.js',
},
name: camelize(name, true),
});
3 changes: 2 additions & 1 deletion packages/chimee-kernel-hls/build/rollup.config.es.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import base from './rollup.config.base';
import base, { banner } from './rollup.config.base';
export default Object.assign(base('es'), {
output: {
banner,
format: 'es',
file: 'lib/index.mjs',
},
Expand Down
5 changes: 3 additions & 2 deletions packages/chimee-kernel-hls/build/rollup.config.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import base from './rollup.config.base';
import base, { banner } from './rollup.config.base';
import uglify from 'rollup-plugin-uglify';
import replace from 'rollup-plugin-replace';
const { name } = require('../package.json');
Expand All @@ -12,6 +12,7 @@ export default Object.assign(config, {
output: {
format: 'umd',
file: 'lib/index.min.js',
name: camelize(name, true),
banner,
},
name: camelize(name, true),
});
5 changes: 3 additions & 2 deletions packages/chimee-kernel-hls/build/rollup.config.umd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import base from './rollup.config.base';
import base, { banner } from './rollup.config.base';
const { name } = require('../package.json');
import { camelize } from 'toxic-utils';
import replace from 'rollup-plugin-replace';
Expand All @@ -10,6 +10,7 @@ export default Object.assign(config, {
output: {
format: 'umd',
file: 'lib/index.browser.js',
banner,
name: camelize(name, true),
},
name: camelize(name, true),
});
2 changes: 1 addition & 1 deletion packages/chimee-kernel-hls/demo/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ window.start = function() {

document.body.appendChild(srcController);

const keys = [ 'play', 'pause', 'load', 'attachMedia', 'seek', 'refresh', 'destroy' ];
const keys = [ 'play', 'pause', 'load', 'startLoad', 'stopLoad', 'attachMedia', 'seek', 'refresh', 'destroy' ];
const controller = document.createElement('div');
keys.forEach(function(key) {
const button = document.createElement('button');
Expand Down
22 changes: 11 additions & 11 deletions packages/chimee-kernel-hls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.3",
"babel-eslint": "^8.2.1",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.23.0",
Expand All @@ -54,29 +54,29 @@
"babel-preset-latest": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^4.1.2",
"chimee-kernel": "^1.3.2",
"eslint": "^4.0.0",
"eslint-config-egg": "^5.1.1",
"eslint-plugin-flowtype": "^2.34.0",
"flow-bin": "^0.61.0",
"chimee-kernel": "^1.4.0",
"eslint": "^4.15.0",
"eslint-config-egg": "^6.0.0",
"eslint-plugin-flowtype": "^2.41.0",
"flow-bin": "^0.63.1",
"husky": "^0.14.3",
"karma": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-coverage-istanbul-reporter": "^1.3.3",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-rollup-preprocessor": "^5.0.2",
"karma-rollup-preprocessor": "^5.1.1",
"karma-sourcemap-loader": "^0.3.7",
"mocha": "^4.0.1",
"mocha": "^4.1.0",
"pkg-ok": "^1.1.0",
"rollup": "^0.52.3",
"rollup": "^0.54.1",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-flow-no-whitespace": "^1.0.0",
"rollup-plugin-includepaths": "^0.2.2",
"rollup-plugin-livereload": "^0.6.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-serve": "^0.4.0",
"rollup-plugin-uglify": "^2.0.1",
Expand Down
8 changes: 8 additions & 0 deletions packages/chimee-kernel-hls/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export default class Hls extends CustEvent {
return this.hlsKernel.loadSource(this.config.src);
}

startLoad() {
return this.hlsKernel.startLoad();
}

stopLoad() {
return this.hlsKernel.stopLoad();
}

attachMedia() {
return this.hlsKernel.attachMedia(this.video);
}
Expand Down

0 comments on commit 02384df

Please sign in to comment.