Skip to content

Commit

Permalink
Merge pull request #49 from tjenkinson/patch-1
Browse files Browse the repository at this point in the history
Update for clappr v0.2.52 when properties became private
  • Loading branch information
flavioribeiro committed Jun 14, 2016
2 parents 3b97f3c + 77f4ef4 commit 858f76e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ 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.startLevel = this.options.rtmpConfig.startLevel === undefined ? -1 : this.options.rtmpConfig.startLevel
this.setupPlaybackType()
this._setupPlaybackType()
}

getPlaybackType() {
return this.playbackType
return this._playbackType
}

get swfPath() {
Expand Down Expand Up @@ -83,14 +83,14 @@ export default class RTMP extends Flash {
}

addListeners() {
Mediator.on(this.uniqueId + ':progress', this.progress, this)
Mediator.on(this.uniqueId + ':timeupdate', this.updateTime, this)
Mediator.on(this.uniqueId + ':statechanged', this.checkState, this)
Mediator.on(this.uniqueId + ':playbackready', this.playbackReady, this)
Mediator.on(this.uniqueId + ':onloaded', this.reporLevels, this)
Mediator.on(this.uniqueId + ':levelChanging', this.levelChanging, this)
Mediator.on(this.uniqueId + ':levelChanged', this.levelChange, this)
Mediator.on(this.uniqueId + ':flashready', this.bootstrap, this)
Mediator.on(this.uniqueId + ':progress', this._progress, this)
Mediator.on(this.uniqueId + ':timeupdate', this._updateTime, this)
Mediator.on(this.uniqueId + ':statechanged', this._checkState, this)
Mediator.on(this.uniqueId + ':playbackready', this._playbackReady, this)
Mediator.on(this.uniqueId + ':onloaded', this._reporLevels, this)
Mediator.on(this.uniqueId + ':levelChanging', this._levelChanging, this)
Mediator.on(this.uniqueId + ':levelChanged', this._levelChange, this)
Mediator.on(this.uniqueId + ':flashready', this._bootstrap, this)
}

stopListening() {
Expand All @@ -101,26 +101,26 @@ export default class RTMP extends Flash {
Mediator.off(this.uniqueId + ':flashready')
}

bootstrap() {
_bootstrap() {
this.el.width = '100%'
this.el.height = '100%'
this.options.autoPlay && this.play()
this.setupSettings()
this._setupSettings()
}

updateTime() {
_updateTime() {
if (this.getPlaybackType() === 'live') {
this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: 1, total: 1}, this.name)
} else {
this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: this.el.getPosition(), total: this.el.getDuration()}, this.name)
}
}

levelChanging() {
_levelChanging() {
this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START)
}

levelChange() {
_levelChange() {
this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)
}

Expand All @@ -130,11 +130,11 @@ export default class RTMP extends Flash {
return foundLevel
}

setupPlaybackType() {
this.playbackType = this.options.rtmpConfig.playbackType
_setupPlaybackType() {
this._playbackType = this.options.rtmpConfig.playbackType
}

setupSettings() {
_setupSettings() {
if (this.getPlaybackType() === 'live') {
this.settings.left = ["playpause"]
this.settings.right = ["fullscreen", "volume"]
Expand All @@ -157,16 +157,16 @@ export default class RTMP extends Flash {
this.$el.attr('classid', IE_CLASSID)
}
} else if (Browser.isFirefox) {
this.setupFirefox()
this._setupFirefox()
}
this.el.id = this.cid
var style = Styler.getStyleFor(flashStyle)
this.$el.append(style)
return this
}

checkState() {
super.checkState()
_checkState() {
super._checkState()

if (this.el.getState() === "PLAYING") {
this.trigger(Events.PLAYBACK_PLAY, this.name)
Expand All @@ -175,12 +175,12 @@ export default class RTMP extends Flash {
}
}

playbackReady() {
this.isReadyState = true
_playbackReady() {
this._isReadyState = true
this.trigger(Events.PLAYBACK_READY, this.name)
}

reporLevels() {
_reporLevels() {
if (this.isDynamicStream) {
if (this.levels) {
this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this.levels, this.options.rtmpConfig.startLevel)
Expand Down

0 comments on commit 858f76e

Please sign in to comment.