1 DEFAULT_ERROR = 'You are currently connected via HTTPS but the embedded content
2 uses non-secure plain HTTP. Your browser therefore blocks it from
3 loading due to mixed content policy. To fix this, embed the video using a
4 secure link if available (https://...), or find another source for the content.'
6 genParam = (name, value) ->
12 window.EmbedPlayer = class EmbedPlayer extends Player
13 constructor: (data) ->
14 if not (this instanceof EmbedPlayer)
15 return new EmbedPlayer(data)
20 @setMediaProperties(data)
22 embed = data.meta.embed
24 console.error('EmbedPlayer::load(): missing meta.embed')
27 if embed.tag == 'object'
28 @player = @loadObject(embed)
30 @player = @loadIframe(embed)
34 loadObject: (embed) ->
35 object = $('<object/>').attr(
36 type: 'application/x-shockwave-flash'
40 genParam('allowfullscreen', 'true').appendTo(object)
41 genParam('allowscriptaccess', 'always').appendTo(object)
43 for key, value of embed.params
44 genParam(key, value).appendTo(object)
48 loadIframe: (embed) ->
49 if embed.src.indexOf('http:') == 0 and location.protocol == 'https:'
50 if @__proto__.mixedContentError?
51 error = @__proto__.mixedContentError
54 alert = makeAlert('Mixed Content Error', error, 'alert-danger')
55 .removeClass('col-md-12')
56 alert.find('.close').remove()
59 iframe = $('<iframe/>').attr(