Permalink
Browse files

debug & wmode transparent for youtube video player

  • Loading branch information...
1 parent 81a384a commit 48249e212f4caa60b2968a566f717b843982bc92 @Evangenieur committed Dec 19, 2012
Showing with 8 additions and 3 deletions.
  1. +1 −0 public/javascripts/hvidio.coffee
  2. +7 −3 public/javascripts/video_player.coffee
@@ -342,6 +342,7 @@ window.hvidio =
video = _(@videos[@keyword]).find (vdo) ->
vdo.dom_id is dom_id
+ console.log "Play", video
clearTimeout timerPlay if timerPlay
@@ -8,13 +8,14 @@ class IFramePlayer
if @iframe[k]?
@iframe[k] = v
+ @iframe.src += "?" if @iframe.src.indexOf("?") == -1
switch typeof @opts.src_params
when "object"
for k, v of @opts.src_params
if v is true then v = 1
- @iframe.src += "&#{k}=#{v}"
+ @iframe.src += "#{k}=#{v}&"
when "string"
- @iframe.src += "&#{@opts.src_params}"
+ @iframe.src += "#{@opts.src_params}&"
###
@@ -78,7 +79,10 @@ class IFramePlayer
class YoutubePlayer extends IFramePlayer
constructor: (opts = {}) ->
opts.iframe_params or= {}
- opts.iframe_params.src = "http://www.youtube.com/embed/#{opts.video_id}?enablejsapi=1"
+ opts.iframe_params.src = "http://www.youtube.com/embed/#{opts.video_id}"
+ opts.src_params or= {}
+ opts.src_params.enablejsapi = 1
+ opts.src_params.wmode = "transparent"
opts.events_handler =
onReady: ->
onStateChange: ->

0 comments on commit 48249e2

Please sign in to comment.