mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
添加metadata解析
This commit is contained in:
1 parent
4658d3f4b4
commit
42eb35571d
6 files changed
+536
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import fetchStream from './fetchStream';
|
||||
import readFile from './readFile';
|
||||
import getMetaData from './getMetaData';
|
||||
import { mergeTypedArrays, getUint8Sum } from '../utils';
|
||||
|
||||
export default class FlvParse {
|
||||
@@ -8,6 +9,7 @@ export default class FlvParse {
|
||||
this.uint8 = new Uint8Array(0);
|
||||
this.index = 0;
|
||||
this.header = null;
|
||||
this.metadata = null;
|
||||
this.tags = [];
|
||||
this.done = false;
|
||||
|
||||
@@ -35,6 +37,7 @@ export default class FlvParse {
|
||||
this.uint8 = uint8;
|
||||
this.index = 0;
|
||||
this.header = null;
|
||||
this.metadata = null;
|
||||
this.tags = [];
|
||||
this.parse();
|
||||
}
|
||||
@@ -69,6 +72,10 @@ export default class FlvParse {
|
||||
this.tags.push(tag);
|
||||
this.read(4);
|
||||
}
|
||||
|
||||
if (this.tags.length > 1 && this.tags[0].tagType[0] === 18 && !this.metadata) {
|
||||
this.metadata = getMetaData(this.tags[0]);
|
||||
}
|
||||
}
|
||||
|
||||
read(length) {
|
||||
@@ -91,6 +98,7 @@ export default class FlvParse {
|
||||
}
|
||||
});
|
||||
console.log(this.header);
|
||||
console.log(this.metadata);
|
||||
console.log(this.tags);
|
||||
console.log(types);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user