Skip to content

Commit

Permalink
Merge pull request #62 from eventials/master
Browse files Browse the repository at this point in the history
RTMPS and proxyType option
  • Loading branch information
Germano Fronza authored Aug 19, 2016
2 parents a3f8dd3 + aa5734b commit 1627a87
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The plugin accepts several **optional** configuration options, such as:
- `bufferTime` (default **0.1**) - How long to buffer before start playing the media.
- `startLevel` (default **-1**) - Initial quality level index.
- `useAppInstance` (default **false**) - Set it to `true` if your source url contains the app instance (not required if the app instance is `_definst_`).
- `proxyType` (default **none**) - Determines which fallback methods are tried if an initial connection attempt to Flash Media Server fails.

## Building

Expand Down
Binary file modified dist/assets/RTMP.swf
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/rtmp.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/rtmp.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rtmp.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clappr-rtmp",
"version": "0.0.14",
"version": "0.0.15-rc1",
"description": "RTMP Support for Clappr Player",
"main": "dist/rtmp.js",
"author": "Flávio Ribeiro",
Expand Down
Binary file modified public/RTMP.swf
Binary file not shown.
4 changes: 2 additions & 2 deletions public/flash.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param name="allowFullScreen" value="false">
<param name="wmode" value="<%= wmode %>">
<param name="tabindex" value="1">
<param name=FlashVars value="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"/>
<param name=FlashVars value="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>&proxyType=<%= proxyType %>"/>
<embed
name="<%= cid %>"
type="application/x-shockwave-flash"
Expand All @@ -22,7 +22,7 @@
swliveconnect="true"
allowfullscreen="false"
bgcolor="#000000"
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>&proxyType=<%= proxyType %>"
src="<%= swfPath %>"
width="100%"
height="100%">
Expand Down
Binary file modified src/OSMF.swc
Binary file not shown.
6 changes: 4 additions & 2 deletions src/RTMP.as
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ package {
private var playbackState:String = "IDLE";
private var isLive:Boolean = false;
private var useAppInstance:Boolean = false;
private var proxyType:String = "none";

CONFIG::LOGGING {
private static const logInit:Boolean = initLog();
Expand All @@ -71,6 +72,7 @@ package {
playbackId = this.root.loaderInfo.parameters.playbackId;
isLive = this.root.loaderInfo.parameters.playbackType == 'live';
useAppInstance = this.root.loaderInfo.parameters.useAppInstance == 'true';
proxyType = this.root.loaderInfo.parameters.proxyType;
mediaFactory = new DefaultMediaFactory();
mediaContainer = new MediaContainer();

Expand Down Expand Up @@ -195,9 +197,9 @@ package {
try {
if (!mediaElement) {
if (isLive) {
urlResource = new StreamingURLResource(url, StreamType.LIVE, NaN, NaN, null, useAppInstance);
urlResource = new StreamingURLResource(url, StreamType.LIVE, NaN, NaN, null, useAppInstance, null, proxyType);
} else {
urlResource = new StreamingURLResource(url, StreamType.RECORDED, NaN, NaN, null, useAppInstance);
urlResource = new StreamingURLResource(url, StreamType.RECORDED, NaN, NaN, null, useAppInstance, null, proxyType);
}

var startLevel:int = int(this.root.loaderInfo.parameters.startLevel);
Expand Down
Binary file modified src/SMILPlugin.swc
Binary file not shown.
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class RTMP extends Flash {
this.options.rtmpConfig.scaling = this.options.rtmpConfig.scaling || 'letterbox'
this.options.rtmpConfig.playbackType = this.options.rtmpConfig.playbackType || this.options.src.indexOf('live') > -1
this.options.rtmpConfig.useAppInstance = this.options.rtmpConfig.useAppInstance === undefined ? false : this.options.rtmpConfig.useAppInstance
this.options.rtmpConfig.proxyType = this.options.rtmpConfig.proxyType || 'none'
this.options.rtmpConfig.startLevel = this.options.rtmpConfig.startLevel === undefined ? -1 : this.options.rtmpConfig.startLevel
this.addListeners()
this._setupPlaybackType()
Expand Down Expand Up @@ -155,7 +156,7 @@ export default class RTMP extends Flash {

render() {
this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId, wmode: this.options.rtmpConfig.wmode, scaling: this.options.rtmpConfig.scaling,
bufferTime: this.options.rtmpConfig.bufferTime, playbackType: this.options.rtmpConfig.playbackType, startLevel: this.options.rtmpConfig.startLevel, useAppInstance: this.options.rtmpConfig.useAppInstance }))
bufferTime: this.options.rtmpConfig.bufferTime, playbackType: this.options.rtmpConfig.playbackType, startLevel: this.options.rtmpConfig.startLevel, useAppInstance: this.options.rtmpConfig.useAppInstance, proxyType: this.options.rtmpConfig.proxyType }))
if (Browser.isIE) {
this.$('embed').remove()
if (Browser.isLegacyIE) {
Expand Down Expand Up @@ -195,7 +196,7 @@ export default class RTMP extends Flash {
}

RTMP.canPlay = function (source) {
return !!((source.indexOf('rtmp://') > -1 || source.indexOf('.smil') > -1) && Browser.hasFlash)
return !!((source.indexOf('rtmp://') > -1 || source.indexOf('rtmps://') > -1 || source.indexOf('.smil') > -1) && Browser.hasFlash)
};

RTMP.debug = s => console.log(s)

0 comments on commit 1627a87

Please sign in to comment.