fix: flv live play return result of video.play()

This commit is contained in:
leonardoFu 2019-11-05 18:21:17 +08:00
parent bbcf25b9f1
commit d6b8296fda
21 changed files with 934 additions and 45 deletions

View File

@ -2,10 +2,12 @@
"presets": [
["env", {
"targets": {
"node": true,
"chrome": "55",
"ie": "8"
"node": true
}
}]
],
"plugins": [
"transform-es2015-parameters",
"transform-es2015-spread"
]
}

@ -1 +1 @@
Subproject commit a0a00021345e2bbea0ac129d80ec2b9e9e95d12d
Subproject commit 2d6a273e5b6c2020856964192ed02b09069305d3

View File

@ -4,6 +4,8 @@
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-node": "^0.0.1-security",
"babel-plugin-transform-es2015-parameters": "^6.24.1",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"css-loader": "^0.28.11",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -65,20 +65,20 @@ class FlvPlayer extends Player {
this.flv = flv
}
play() {
play () {
if (this._hasStart) {
this._destroy().then(() => {
return this._destroy().then(() => {
this.context = new Context(flvAllowedEvents)
const flv = this.context.registry('FLV_CONTROLLER', FLV)(this)
this.initFlvEvents(flv)
this.flv = flv
this.context.init()
super.start(flv.mse.url)
super.play()
return super.play()
})
} else {
super.play()
return super.play()
}
}

View File

@ -9,7 +9,7 @@ const developUMD = webpackMerge(umd, {
libraryTarget: 'umd'
},
devtool: 'inline-source-map',
mode: 'development'
mode: 'development',
})
const developClient = webpackMerge(client, {

View File

@ -1,4 +1,3 @@
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const polyfill = []
const umd = {
@ -34,16 +33,7 @@ const umd = {
'xgplayer': 'xgplayer'
},
optimization: {
minimize: true,
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
compress: {
drop_console: true
}
}
})
]
minimize: true
}
}
@ -80,16 +70,7 @@ const client = {
},
mode: 'production',
optimization: {
minimize: true,
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
compress: {
drop_console: true,
}
}
})
]
minimize: true
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,6 @@
const { umd, client } = require('../../webpack.config')
const polyfill = []
umd.output = {
path: `${__dirname}/dist`,
filename: 'index.js',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "xgplayer-flv",
"version": "2.2.0-alpha.10",
"version": "2.2.0-alpha.13",
"description": "flv demuxer for xgplayer",
"main": "./dist/index.js",
"scripts": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -76,8 +76,8 @@ class Context {
const checkMessageName = this._isMessageNameValid.bind(this)
const self = this
const enhanced = class extends cls {
constructor (...args) {
super(...args)
constructor (a, b, c) {
super(a, b, c)
this.listeners = {}
this.onceListeners = {}
this.TAG = tag