Skip to content

Commit 81c8dda

Browse files
author
Germano Fronza
authored
Merge pull request #59 from eventials/master
Added parameter to identify app instance in the source URL
2 parents 9347c7f + fa1d1f2 commit 81c8dda

9 files changed

Lines changed: 19 additions & 16 deletions

File tree

dist/assets/RTMP.swf

17 Bytes
Binary file not shown.

dist/rtmp.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rtmp.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rtmp.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "clappr-rtmp",
3-
"version": "0.0.13",
3+
"version": "0.0.14",
44
"description": "RTMP Support for Clappr Player",
55
"main": "dist/rtmp.js",
66
"author": "Flávio Ribeiro",

public/RTMP.swf

17 Bytes
Binary file not shown.

public/flash.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<param name="allowFullScreen" value="false">
88
<param name="wmode" value="<%= wmode %>">
99
<param name="tabindex" value="1">
10-
<param name=FlashVars value="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>"/>
10+
<param name=FlashVars value="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"/>
1111
<embed
1212
name="<%= cid %>"
1313
type="application/x-shockwave-flash"
@@ -22,8 +22,8 @@
2222
swliveconnect="true"
2323
allowfullscreen="false"
2424
bgcolor="#000000"
25-
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>"
25+
FlashVars="playbackId=<%= playbackId %>&scaling=<%= scaling %>&bufferTime=<%= bufferTime %>&playbackType=<%= playbackType %>&startLevel=<%= startLevel %>&useAppInstance=<%= useAppInstance %>"
2626
src="<%= swfPath %>"
2727
width="100%"
2828
height="100%">
29-
</embed>
29+
</embed>

src/RTMP.as

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ package {
5151
private var urlResource:StreamingURLResource;
5252
private var playbackState:String = "IDLE";
5353
private var isLive:Boolean = false;
54+
private var useAppInstance:Boolean = false;
5455

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

7071
playbackId = this.root.loaderInfo.parameters.playbackId;
7172
isLive = this.root.loaderInfo.parameters.playbackType == 'live';
73+
useAppInstance = this.root.loaderInfo.parameters.useAppInstance == 'true';
7274
mediaFactory = new DefaultMediaFactory();
7375
mediaContainer = new MediaContainer();
7476

@@ -193,9 +195,9 @@ package {
193195
try {
194196
if (!mediaElement) {
195197
if (isLive) {
196-
urlResource = new StreamingURLResource(url, StreamType.LIVE);
198+
urlResource = new StreamingURLResource(url, StreamType.LIVE, NaN, NaN, null, useAppInstance);
197199
} else {
198-
urlResource = new StreamingURLResource(url, StreamType.RECORDED);
200+
urlResource = new StreamingURLResource(url, StreamType.RECORDED, NaN, NaN, null, useAppInstance);
199201
}
200202

201203
var startLevel:int = int(this.root.loaderInfo.parameters.startLevel);

src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default class RTMP extends Flash {
2828
this.options.rtmpConfig.bufferTime = this.options.rtmpConfig.bufferTime === undefined ? 0.1 : this.options.rtmpConfig.bufferTime
2929
this.options.rtmpConfig.scaling = this.options.rtmpConfig.scaling || 'letterbox'
3030
this.options.rtmpConfig.playbackType = this.options.rtmpConfig.playbackType || this.options.src.indexOf('live') > -1
31+
this.options.rtmpConfig.useAppInstance = this.options.rtmpConfig.useAppInstance === undefined ? false : this.options.rtmpConfig.useAppInstance
3132
this.options.rtmpConfig.startLevel = this.options.rtmpConfig.startLevel === undefined ? -1 : this.options.rtmpConfig.startLevel
3233
this.addListeners()
3334
this._setupPlaybackType()
@@ -154,7 +155,7 @@ export default class RTMP extends Flash {
154155

155156
render() {
156157
this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId, wmode: this.options.rtmpConfig.wmode, scaling: this.options.rtmpConfig.scaling,
157-
bufferTime: this.options.rtmpConfig.bufferTime, playbackType: this.options.rtmpConfig.playbackType, startLevel: this.options.rtmpConfig.startLevel }))
158+
bufferTime: this.options.rtmpConfig.bufferTime, playbackType: this.options.rtmpConfig.playbackType, startLevel: this.options.rtmpConfig.startLevel, useAppInstance: this.options.rtmpConfig.useAppInstance }))
158159
if (Browser.isIE) {
159160
this.$('embed').remove()
160161
if (Browser.isLegacyIE) {

0 commit comments

Comments
 (0)