Skip to content

Commit

Permalink
Release v2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed May 12, 2017
1 parent 16c76e0 commit 5a74ae6
Show file tree
Hide file tree
Showing 87 changed files with 7,407 additions and 52,482 deletions.
42 changes: 27 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
{
"env": {
"es6": true,
"browser": true,
"commonjs": true,
"mocha": true
},

"globals": {
"__DEV__": true
},

"plugins": [
"react"
],

"extends": "eslint:recommended",

"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
}
},

"rules": {
// Possible Errors <http://eslint.org/docs/rules/#possible-errors>
// babel removes them for older browsers, we should do a codemod
Expand Down Expand Up @@ -68,31 +92,19 @@
// style guide: Always use brackets, even when optional.
'curly': [1, 'all'],

// we need this
'no-case-declarations': 0,

'no-var': 1,
'prefer-const': 1,

'max-len': [1, 120, 2,
{'ignorePattern': maxLenIgnorePattern},
{'ignorePattern': maxLenIgnorePattern}
],

"indent": [1, 2],
"quotes": [1, "double"],
"linebreak-style": [1, "unix"],
"semi": [1, "always"],
},
"env": {
"es6": true,
"browser": true,
"commonjs": true
},
"globals": {
"__DEV__": true,
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"react/jsx-uses-vars": [2],
"react/jsx-uses-react": [2]
}
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
node_modules
*.log
*.keys
*.iml

dist/*
example/*
!dist/rx-player.js
!dist/rx-player.min.js
test-output.xml

demo/bundle.js
14 changes: 14 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ Returns an array availables languages/subtitles.

Returns current language/subtitle. `null` if not set.

### `isLanguageAvailable(lng: string)/isSubtitleAvailable(sub: string): boolean`

Check whether the given language/subtitle is available. This method is useful because it normalizes the given language to match against the list of langs.

### `normalizeLanguageCode(lng: string): string`

Normalizes the language code.

### Bitrates

#### `getAvailableVideoBitrates()/getAvailableAudioBitrates() : []int`
Expand Down Expand Up @@ -233,6 +241,11 @@ This method can be call anytime, even if a stream is already loaded an played by

Number used as initial video and audio bitrates by the adaptive streaming.

* `options.hideNativeSubtitle`

Default : false
Hide the native subtitle

#### `play() : void`

Starts video playback. Should be called when the stream is ready, eg. when state machine reaches the state `LOADED`.
Expand Down Expand Up @@ -358,6 +371,7 @@ Adds a listener on an event. The avaiable events are :
- `"fullscreenChange", bool`: changes in fullscreen state
- `"error", Error`: asynchronous error that was fatal to playback
- `"warning", Error`: asynchronous error that was not fatal to playback
- `"nativeTextTrackChange", Object`: textTrack element creation, triggered only if not null

#### `removeEventListener(event, func)`

Expand Down
55 changes: 8 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rx-player
=========
===============

Latest release: v2.0.0-alpha6
Latest release: v2.0.12

The rx-player is a Javascript library implementic a generic streaming video player using HTML5 Media Source and Encrypted Media extensions. It is entirely written in reactive-programming with ECMAScript 6.

Expand Down Expand Up @@ -57,51 +57,6 @@ Or with tools like [Browserify](http://browserify.org/) or
[Webpack](http://webpack.github.io/) you can import the player as a CommonJS
or AMD dependency.

## Example

We will create a simply working player app just in 4 simple steps:
- Create a directory ```example```.
- Copy ```rx-player.js``` in ```example``` directory.
- Copy this content in ```example/index.html```.
```html
<!DOCTYPE html>
<html>
<head>
<!--Our amazing player-->
<title>rx-player</title>
</head>
<body>
<!--We create a video container for our player-->
<video width="100%" id="videoEl" class="video"></video>
<!--Include the player-->
<script src="rx-player.js"></script>
<script>
// Here we use ECMAScript 6 syntax and we recuperate a video container
const videoElement = document.getElementById("videoEl");
// We instanciate our player
const rxPlayer = new RxPlayer({
videoElement,
});
// The stream definition
const unifiedStream = {
name: "Unified Streaming Live",
url: "http://live.unified-streaming.com/loop/loop.isml/loop.mpd?format=mp4&session_id=25020",
transport: "dash",
ciphered: false,
live: true,
autoPlay: true,
};
// We run the stream in player
rxPlayer.loadVideo(unifiedStream);
</script>
</body>
</html>
```
- Expose example directory with your prefered web-server. For example
```bash
python -m SimpleHTTPServer 8080
```

## Dependencies

- [RxJS](https://github.com/Reactive-Extensions/RxJS)
Expand Down Expand Up @@ -154,10 +109,16 @@ on the page https://www.youtube.com/html5 and check support for MSE & H.264.

## Launch tests


### Unit Testing
Tests are only usable from the browser for now due to dependencies on DOM
elements. We plan to add support for `node` only tests asap.

```sh
# starts a local webserver, open http://localhost:9999/webpack-dev-server/test
make test
```

### Functional Testing

See [this document](./test/func/README.md)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-alpha6
2.0.12
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ version=`cat VERSION`
changelog=`awk "/^v[0-9]/{flag=0} /^v${version}/{flag=1} flag {print}" CHANGELOG`

echo "record state in git..."
git commit -m "Release v${version}" -- dist/ package.json CHANGELOG README.md VERSION src/core/player.js
git commit -m "Release v${version}" -- demo/ dist/ package.json CHANGELOG README.md VERSION src/core/player.js
git tag -a v${version} -m v${version} -m "${changelog}" HEAD
Binary file added demo/assets/spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5a74ae6

Please sign in to comment.