Skip to content

Commit

Permalink
Merge pull request bytedance#109 from bytedance/zhangxin-newlogo
Browse files Browse the repository at this point in the history
feat(xgplayer): add preview local file function; publish v1.1.3 version
  • Loading branch information
zhangxin92 authored Oct 26, 2018
2 parents d8ac3f3 + 432c81f commit 9e62adc
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 1,334 deletions.
661 changes: 9 additions & 652 deletions packages/xgplayer-flv.js/browser/index.js

Large diffs are not rendered by default.

671 changes: 9 additions & 662 deletions packages/xgplayer-flv.js/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-flv.js",
"version": "1.1.2",
"version": "1.1.3",
"description": "web video player",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-flv/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-flv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-flv",
"version": "1.1.2",
"version": "1.1.3",
"description": "flv demuxer for xgplayer",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-hls.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-hls.js",
"version": "1.1.2",
"version": "1.1.3",
"description": "xgplayer plugin for hls",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-hls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-hls",
"version": "1.1.2",
"version": "1.1.3",
"description": "xgplayer plugin for hls",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-logger",
"version": "1.1.2",
"version": "1.1.3",
"description": "视频监控",
"main": "./dist/index.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-m4a/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4341,7 +4341,7 @@ module.exports = exports['default'];
/* 80 */
/***/ (function(module) {

module.exports = {"name":"xgplayer-m4a","version":"1.1.3-alpha","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":"[email protected]:bytedance/xgplayer.git"},"babel":{"presets":["es2015"],"plugins":["add-module-exports","babel-plugin-bulk-import"]},"keywords":["mp4","fmp4","player","audio"],"author":"[email protected]","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"}};
module.exports = {"name":"xgplayer-m4a","version":"1.1.3","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":"[email protected]:bytedance/xgplayer.git"},"babel":{"presets":["es2015"],"plugins":["add-module-exports","babel-plugin-bulk-import"]},"keywords":["mp4","fmp4","player","audio"],"author":"[email protected]","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"}};

/***/ }),
/* 81 */
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-m4a/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4351,7 +4351,7 @@ module.exports = exports['default'];
/* 80 */
/***/ (function(module) {

module.exports = {"name":"xgplayer-m4a","version":"1.1.3-alpha","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":"[email protected]:bytedance/xgplayer.git"},"babel":{"presets":["es2015"],"plugins":["add-module-exports","babel-plugin-bulk-import"]},"keywords":["mp4","fmp4","player","audio"],"author":"[email protected]","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"}};
module.exports = {"name":"xgplayer-m4a","version":"1.1.3","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":"[email protected]:bytedance/xgplayer.git"},"babel":{"presets":["es2015"],"plugins":["add-module-exports","babel-plugin-bulk-import"]},"keywords":["mp4","fmp4","player","audio"],"author":"[email protected]","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"}};

/***/ }),
/* 81 */
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-m4a/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-m4a",
"version": "1.1.3-alpha",
"version": "1.1.3",
"description": "xgplayer plugin for m4a transform to fmp4",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-mp4/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-mp4/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer-mp4/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-mp4",
"version": "1.1.2",
"version": "1.1.3",
"description": "xgplayer plugin for mp4 transform to fmp4",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-music/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-music",
"version": "1.1.2",
"version": "1.1.3",
"description": "xgplayer plugin for music",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/xgplayer-shaka/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer-shaka",
"version": "1.1.2",
"version": "1.1.3",
"description": "xgplayer plugin for shaka-player",
"main": "./dist/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/xgplayer/browser/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/xgplayer/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xgplayer",
"version": "1.1.3-beta-7",
"version": "1.1.3",
"description": "video player",
"main": "./dist/index.js",
"scripts": {
Expand Down
23 changes: 23 additions & 0 deletions packages/xgplayer/src/control/localPreview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Player from '../player'

let localPreview = function () {
let player = this; let util = Player.util
let preview = util.createDom('xg-preview', '<input type="file">', {}, 'xgplayer-preview')
let upload = preview.querySelector('input')
if (player.config.preview && player.config.preview.uploadEl) {
player.config.preview.uploadEl.appendChild(preview)
upload.onchange = function () {
player.uploadFile = upload.files[0]
let url = URL.createObjectURL(player.uploadFile)
if (util.hasClass(player.root, 'xgplayer-nostart')) {
player.config.url = url
player.start()
} else {
player.src = url
player.play()
}
}
}
}

Player.install('localPreview', localPreview)

0 comments on commit 9e62adc

Please sign in to comment.