-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xgplayer-m4a): add plugin for converting m4a to fmp4
- Loading branch information
1 parent
f74180d
commit 9439d74
Showing
102 changed files
with
15,073 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "xgplayer-m4a", | ||
"version": "1.1.0", | ||
"description": "xgplayer plugin for m4a transform to fmp4", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"prepare": "npm run build", | ||
"build": "webpack --progress --display-chunks -p", | ||
"watch": "webpack --progress --display-chunks -p --watch" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:bytedance/xgplayer.git" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015" | ||
], | ||
"plugins": [ | ||
"add-module-exports", | ||
"babel-plugin-bulk-import" | ||
] | ||
}, | ||
"keywords": [ | ||
"mp4", | ||
"fmp4", | ||
"player", | ||
"audio" | ||
], | ||
"author": "yinguohui@bytedance.com", | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-bulk-import": "^1.0.2", | ||
"babel-preset-es2015": "^6.24.1", | ||
"concat-typed-array": "^1.0.2", | ||
"deepmerge": "^2.0.1", | ||
"event-emitter": "^0.3.5", | ||
"import-local": "^2.0.0", | ||
"json-loader": "^0.5.7", | ||
"webpack": "^4.11.0" | ||
}, | ||
"peerDependency": { | ||
"xgplayer": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Player from 'xgplayer' | ||
import {version} from '../package.json' | ||
|
||
class _Errors extends Player.Errors { | ||
constructor (type, vid, errd = {}, url = '') { | ||
errd.version = version | ||
super(type, vid, errd) | ||
this.url = url | ||
} | ||
} | ||
|
||
export default _Errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Concat from 'concat-typed-array' | ||
|
||
class Buffer { | ||
constructor () { | ||
this.buffer = new Uint8Array(0) | ||
} | ||
write (...buffer) { | ||
let self = this | ||
buffer.forEach(item => { | ||
if (item) { | ||
self.buffer = Concat(Uint8Array, self.buffer, item) | ||
} else { | ||
window.console.error(item) | ||
} | ||
}) | ||
} | ||
static writeUint32 (value) { | ||
return new Uint8Array([ | ||
value >> 24, | ||
(value >> 16) & 0xff, | ||
(value >> 8) & 0xff, | ||
value & 0xff | ||
]) | ||
} | ||
} | ||
|
||
export default Buffer |
Oops, something went wrong.