Skip to content

Commit

Permalink
Merge pull request #9 from cycdpo/dev
Browse files Browse the repository at this point in the history
update from origin jsmpeg
  • Loading branch information
cycjimmy authored Oct 22, 2018
2 parents 4b5cfc2 + 9b544ab commit ab4405e
Show file tree
Hide file tree
Showing 33 changed files with 8,345 additions and 5,719 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Contributing
The repository is released under the MIT license, and follows a standard Github development process, using Github tracker for issues and merging pull requests into master.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Type of Change
<!-- What type of change does your code introduce? -->
- [ ] New feature
- [ ] Bug fix
- [ ] Documentation
- [ ] Refactor
- [ ] Chore

### Resolves
- Fixes #[Add issue number here.]

### Describe Changes
<!-- Describe your changes in detail, if applicable. -->
_Describe what this Pull Request does_

6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# IDE
.idea
.editorconfig

# doc
.github

# test
test
.travis.yml

# project
src
static
dist
static
yarn.lock

46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at cycjimmy@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

* JSMpeg player is based on [jsmpeg](https://github.com/phoboslab/jsmpeg).
* 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)
* 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)

[Releases](https://github.com/cycdpo/jsmpeg-player/releases) | [Demo](https://cycdpo.github.io/jsmpeg-player/)

Expand All @@ -47,22 +47,22 @@
new JSMpeg.VideoElement(videoWrapper, videoUrl, [, options])
```

* `videoWrapper`: [string|element] the wrapper of video. Height and width of wrapper must be initialized
* `videoUrl`: [string] a url to an MPEG .ts file
* The `options` supports:
* `poster`: [string] URL to an image to use as the poster to show before the video plays.(Recommended to set it manually)
* `autoplay`: [boolean] whether to start playing immediately. Default `false`.
* `loop`: [boolean] whether to loop the video (static files only). Default `false`.**[overwrite]**
* `aspectPercent`: [string] Aspect ratio converted to percentage. E.g: '16:9' => `'56.25%'`. Default `'56.25%'`.
* `picMode`: [boolean] picture node (no playButton). Default `false`.
* `chunkSize` the chunk size in bytes to load at a time. Default `1024*1024` (1mb).
* `hookInPlay`: [function] The hook function when the video play.
* `hookInPause`: [function] The hook function when the video pause.
* `hookInStop`: [function] The hook function when the video stop.
* `videoWrapper`: [String | Element] The wrapper of the video. Height and width of wrapper must be initialized.
* `videoUrl`: [String] A URL to an MPEG .ts file
* The `options` support:
* `poster`: [String] URL to an image to use as the poster to show before the video plays. (Recommended to set it manually)
* `autoplay`: [Boolean] Whether to start playing immediately. Default `false`.
* `loop`: [Boolean] Whether to loop the video (static files only). Default `false`.**[overwrite]**
* `aspectPercent`: [String] Aspect ratio converted to percentage. E.g: '16:9' => `'56.25%'`. Default `'56.25%'`.
* `picMode`: [Boolean] Picture mode (no playButton). Default `false`.
* `chunkSize` [Number] The chunk size in bytes to load at a time. Default `1024*1024` (1mb).
* `hookInPlay`: [Function] The hook function when the video play.
* `hookInPause`: [Function] The hook function when the video pause.
* `hookInStop`: [Function] The hook function when the video stop.
* More options can view the [jsmpeg options](https://github.com/phoboslab/jsmpeg#usage)

* `JSMpeg.VideoElement` instance supports the following methods:
* `destroy()`: Empty videoWrapper.
* `destroy()`: Empty video wrapper.
* `JSMpeg.VideoElement.player` instance API can view the [JSMpeg.Player API](https://github.com/phoboslab/jsmpeg#jsmpegplayer-api)

### Use in browser
Expand All @@ -76,7 +76,7 @@
```

## CDN
To use via a CDN include this in your html:
To use via a CDN include this in your HTML:
```text
<script src="https://cdn.jsdelivr.net/npm/jsmpeg-player@1/build/JSMpeg.min.js"></script>
```
Expand Down
Loading

0 comments on commit ab4405e

Please sign in to comment.