Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
add Demo
  • Loading branch information
cycjimmy committed Sep 22, 2017
1 parent 0ebbc02 commit 8f4072d
Show file tree
Hide file tree
Showing 11 changed files with 959 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ npm-debug.log
yarn-error.log

# project
temp
.publish
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src
demo
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* The video must be compressed into the TS format of MPEG1 / MP2.
* Apple device automatically plays without sound, you need to guide the user to click on the video in the lower right corner of the video icon to unlock the sound.(no similar problem in non-autoplay mode)

[Demo](https://cycjimmy.github.io/jsmpeg-player/)

## How to use
### Install
```shell
Expand Down Expand Up @@ -66,7 +68,7 @@
### Use in browser
```html
<div id="videoWrapper"></div>
<script src="dist/JSMpeg.min.js"></script>
<script src="JSMpeg.min.js"></script>
<script>
var videoUrl = '../static/media/test_video.ts';
new JSMpeg.VideoElement('#videoWrapper', videoUrl);
Expand Down
2 changes: 2 additions & 0 deletions demo/JSMpeg.min.js

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JSMpeg Video Test</title>
<style>
#videoWrapper {
margin: 0 auto;
width: 640px;
height: 360px;
}
</style>
</head>

<body>
<div id="videoWrapper"></div>

<script src="./JSMpeg.min.js"></script>
<script>
var
poster = 'https://raw.githubusercontent.com/cycjimmy/staticFiles/storage/images/screenshot/big_buck_bunny_640x360.jpg'
, videoUrl = './media/big_buck_bunny_640x360.ts'
;

var
video = new JSMpeg.VideoElement('#videoWrapper', videoUrl, {
poster,
})
;

console.log(video);
</script>

</body>
</html>
Binary file added demo/media/Sony_test_video_640x360.ts
Binary file not shown.
Binary file added demo/media/big_buck_bunny_640x360.ts
Binary file not shown.
32 changes: 32 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
var
path = require('path')
, gulp = require('gulp')
, ghPages = require('gulp-gh-pages')
, gulpCopy = require('gulp-copy')
;


gulp.task('copy', function () {
var
sourceFiles = path.resolve('dist', 'JSMpeg.min.js')
, destination = path.resolve('demo')
;

return gulp
.src(sourceFiles)
.pipe(gulpCopy(destination, {
prefix: 1
}));
});

// Deploy to ghPages
gulp.task('deploy', function () {
return gulp
.src('demo/**/*')
.pipe(ghPages());
});





8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "jsmpeg-player",
"version": "1.0.0",
"version": "1.0.1",
"description": "MPEG1 Video Player Based On JSMpeg",
"main": "dist/JSMpeg.js",
"module": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --progress --display-modules --display-reasons --display-error-details --color",
"build:production": "cross-env NODE_ENV=production webpack --progress --optimize-minimize",
"prepublish": "npm run build && npm run build:production"
"deploy": "gulp deploy",
"prepublish": "npm run build && npm run build:production && gulp copy"
},
"repository": {
"type": "git",
Expand All @@ -32,6 +33,9 @@
"babel-preset-env": "^1.6.0",
"clean-webpack-plugin": "^0.1.16",
"cross-env": "^5.0.5",
"gulp": "^3.9.1",
"gulp-copy": "^1.0.1",
"gulp-gh-pages": "^0.5.4",
"jest": "^21.1.0",
"regenerator-runtime": "^0.11.0",
"uglify-js": "^3.1.1",
Expand Down
35 changes: 0 additions & 35 deletions test/browser/test.html

This file was deleted.

Loading

0 comments on commit 8f4072d

Please sign in to comment.