diff options
| author | Kawandeep Virdee | 2013-11-09 17:51:15 -0500 |
|---|---|---|
| committer | Kawandeep Virdee | 2013-11-09 17:51:15 -0500 |
| commit | df761dd6400d55d99540d7d769075955681f3093 (patch) | |
| tree | 6d79436683026fe639e7ead5b258e92c45eba2f5 /assets/js/sample.js | |
| parent | 33211b0dba94a2756573a8248219347dd086ae7f (diff) | |
| download | clip-play-df761dd6400d55d99540d7d769075955681f3093.tar.bz2 | |
url to media frame
Diffstat (limited to 'assets/js/sample.js')
| -rw-r--r-- | assets/js/sample.js | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/assets/js/sample.js b/assets/js/sample.js index 1784e86..4297ccd 100644 --- a/assets/js/sample.js +++ b/assets/js/sample.js @@ -5,15 +5,28 @@ function Sample(url){ this.duration; this.key; this.player; //the associated player obj w the iframe - this.init(); this.id; + this.iframe; + this.init(); } -Sample.prototype.init(){ - //create the iframe - - //create the player - +Sample.prototype.init = function(){ + var that = this; + $.embedly.oembed(this.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 schema = data.provider_name.toLowerCase(); + var iframe_src= BASE_IFRAME +"?schema="+schema+"&type=text%2Fhtml&html="+src; + var iframe = $('<iframe/>', { + src: iframe_src + }); + $('body').append(iframe[0]); + var player = new OP.Player(iframe[0]); + that.player = player; + that.iframe = iframe; + }); } Sample.prototype.play = function(){ |
