Skip to content

Commit

Permalink
Merge pull request #59 from eventials/master
Browse files Browse the repository at this point in the history
Added parameter to identify app instance in the source URL
  • Loading branch information
Germano Fronza authored Aug 19, 2016
2 parents 9347c7f + fa1d1f2 commit 81c8dda
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
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.

12 changes: 6 additions & 6 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.13",
"version": "0.0.14",
"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.
6 changes: 3 additions & 3 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 %>"/>
<param name=FlashVars value="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"/>
<embed
name="<%= cid %>"
type="application/x-shockwave-flash"
Expand All @@ -22,8 +22,8 @@
swliveconnect="true"
allowfullscreen="false"
bgcolor="#000000"
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>"
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"
src="<%= swfPath %>"
width="100%"
height="100%">
</embed>
</embed>
6 changes: 4 additions & 2 deletions src/RTMP.as
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ package {
private var urlResource:StreamingURLResource;
private var playbackState:String = "IDLE";
private var isLive:Boolean = false;
private var useAppInstance:Boolean = false;

CONFIG::LOGGING {
private static const logInit:Boolean = initLog();
Expand All @@ -69,6 +70,7 @@ package {

playbackId = this.root.loaderInfo.parameters.playbackId;
isLive = this.root.loaderInfo.parameters.playbackType == 'live';
useAppInstance = this.root.loaderInfo.parameters.useAppInstance == 'true';
mediaFactory = new DefaultMediaFactory();
mediaContainer = new MediaContainer();

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

var startLevel:int = int(this.root.loaderInfo.parameters.startLevel);
Expand Down
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default class RTMP extends Flash {
this.options.rtmpConfig.bufferTime = this.options.rtmpConfig.bufferTime === undefined ? 0.1 : this.options.rtmpConfig.bufferTime
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.startLevel = this.options.rtmpConfig.startLevel === undefined ? -1 : this.options.rtmpConfig.startLevel
this.addListeners()
this._setupPlaybackType()
Expand Down Expand Up @@ -154,7 +155,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 }))
bufferTime: this.options.rtmpConfig.bufferTime, playbackType: this.options.rtmpConfig.playbackType, startLevel: this.options.rtmpConfig.startLevel, useAppInstance: this.options.rtmpConfig.useAppInstance }))
if (Browser.isIE) {
this.$('embed').remove()
if (Browser.isLegacyIE) {
Expand Down

0 comments on commit 81c8dda

Please sign in to comment.