Created
July 21, 2015 01:31
-
-
Save MeoMix/9f6957a75299e5134dbd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MediaSourceWrapper = require('foreground/model/mediaSourceWrapper'); | |
var VideoView = Marionette.ItemView.extend({ | |
el: '#video', | |
mediaSourceWrapper: null, | |
mediaSourceWrapperEvents: { | |
'change:objectURL': '_onMediaSourceWrapperChangeObjectURL' | |
}, | |
initialize: function() { | |
this.mediaSourceWrapper = new MediaSourceWrapper(); | |
this.bindEntityEvents(this.mediaSourceWrapper, this.mediaSourceWrapperEvents); | |
}, | |
_onMediaSourceWrapperChangeObjectURL: function(mediaSourceWrapper, objectURL) { | |
this._setVideoSrc(objectURL); | |
}, | |
_setVideoSrc: function(objectURL) { | |
var videoSrc = objectURL === null ? '' : objectURL; | |
this.el.src = videoSrc; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment