summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKawandeep Virdee2013-11-09 23:00:09 -0500
committerKawandeep Virdee2013-11-09 23:00:09 -0500
commitc6ea89e472f21a71d3cae95643b8fbde4bb22b17 (patch)
tree28cc42941619ada6b8d8c73e8acba21580afab99
parentfad0307976a0664f11a69911661d8e387c4b3aab (diff)
downloadclip-play-c6ea89e472f21a71d3cae95643b8fbde4bb22b17.tar.bz2
fixed for soundcloud
-rw-r--r--assets/js/views/sample.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js
index e28a964..ef1d681 100644
--- a/assets/js/views/sample.js
+++ b/assets/js/views/sample.js
@@ -1,47 +1,49 @@
ClipPlay.Views.Sample = Marionette.ItemView.extend({
template: '#sample-view-template',
-
+
onRender: function() {
this.initialize_player();
this.initialize_clip_drag_handles();
},
-
-
+
+
initialize_player: function() {
var that = this;
$.embedly.oembed(this.model.get('url')).done(function(results){
var BASE_IFRAME = "http://cdn.embedly.com/widgets/media.html";
var data = results[0];
var f= data.html;
- var src = $(f)[0].src;
+ var src = encodeURIComponent($(f)[0].src);
var schema = data.provider_name.toLowerCase();
var iframe_src= BASE_IFRAME +"?schema="+schema+"&type=text%2Fhtml&html="+src;
+ console.log(iframe_src);
var iframe = $('<iframe/>', {
src: iframe_src
});
+ console.log(iframe[0]);
$('#video').append(iframe[0]);
var player = new OP.Player(iframe[0]);
that.model.set('player', player);
that.model.set('iframe', iframe);
});
},
-
-
+
+
initialize_clip_drag_handles: function() {
var $clip_line = this.$('.js-clip-line');
-
+
$clip_line.draggable({
axis: 'x',
handle: '.js-drag-handle',
scroll: false,
containment: $clip_line.parents('.progress-bar')
});
-
+
$clip_line.on('dragstop', this.on_clip_drag_stop);
},
-
-
+
+
on_clip_drag_stop: function(e, ui) {
console.log('booyakacha');
}
-}); \ No newline at end of file
+});