Add LIVESTREAM_CHROMELESS flag

This commit is contained in:
Calvin Montgomery 2015-07-05 14:00:59 -07:00
parent 9f030376b5
commit aad8eef52b
4 changed files with 50 additions and 36 deletions

View File

@ -10,9 +10,9 @@ var order = [
'videojs.coffee',
'raw-file.coffee',
'soundcloud.coffee',
'livestream.com.coffee',
'twitch.coffee',
'embed.coffee',
'livestream.com.coffee',
'custom-embed.coffee',
'rtmp.coffee',
'hitbox.coffee',

View File

@ -1,4 +1,4 @@
window.LivestreamPlayer = class LivestreamPlayer extends Player
window.LivestreamPlayer = class LivestreamPlayer extends EmbedPlayer
constructor: (data) ->
if not (this instanceof LivestreamPlayer)
return new LivestreamPlayer(data)
@ -6,14 +6,18 @@ window.LivestreamPlayer = class LivestreamPlayer extends Player
@load(data)
load: (data) ->
@setMediaProperties(data)
@player = $('<iframe/>').attr(
src: "https://cdn.livestream.com/embed/#{data.id}?\
layout=4&\
color=0x000000&\
iconColorOver=0xe7e7e7&\
iconColor=0xcccccc"
frameborder: '0'
)
removeOld(@player)
if LIVESTREAM_CHROMELESS
data.meta.embed =
src: 'https://cdn.livestream.com/chromelessPlayer/v20/playerapi.swf'
tag: 'object'
params:
flashvars: "channel=#{data.id}"
else
data.meta.embed =
src: "https://cdn.livestream.com/embed/#{data.id}?\
layout=4&\
color=0x000000&\
iconColorOver=0xe7e7e7&\
iconColor=0xcccccc"
tag: 'iframe'
super(data)

View File

@ -25,6 +25,7 @@ var CHANNEL = {
};
var PLAYER = false;
var LIVESTREAM_CHROMELESS = false;
var FLUIDLAYOUT = false;
var VWIDTH;
var VHEIGHT;

View File

@ -794,29 +794,6 @@
})(Player);
window.LivestreamPlayer = LivestreamPlayer = (function(superClass) {
extend(LivestreamPlayer, superClass);
function LivestreamPlayer(data) {
if (!(this instanceof LivestreamPlayer)) {
return new LivestreamPlayer(data);
}
this.load(data);
}
LivestreamPlayer.prototype.load = function(data) {
this.setMediaProperties(data);
this.player = $('<iframe/>').attr({
src: "https://cdn.livestream.com/embed/" + data.id + "?layout=4&color=0x000000&iconColorOver=0xe7e7e7&iconColor=0xcccccc",
frameborder: '0'
});
return removeOld(this.player);
};
return LivestreamPlayer;
})(Player);
window.twitchEventCallback = function(events) {
if (!(PLAYER instanceof TwitchPlayer)) {
return false;
@ -941,6 +918,38 @@
})(Player);
window.LivestreamPlayer = LivestreamPlayer = (function(superClass) {
extend(LivestreamPlayer, superClass);
function LivestreamPlayer(data) {
if (!(this instanceof LivestreamPlayer)) {
return new LivestreamPlayer(data);
}
this.load(data);
}
LivestreamPlayer.prototype.load = function(data) {
if (LIVESTREAM_CHROMELESS) {
data.meta.embed = {
src: 'https://cdn.livestream.com/chromelessPlayer/v20/playerapi.swf',
tag: 'object',
params: {
flashvars: "channel=" + data.id
}
};
} else {
data.meta.embed = {
src: "https://cdn.livestream.com/embed/" + data.id + "?layout=4&color=0x000000&iconColorOver=0xe7e7e7&iconColor=0xcccccc",
tag: 'iframe'
};
}
return LivestreamPlayer.__super__.load.call(this, data);
};
return LivestreamPlayer;
})(EmbedPlayer);
CUSTOM_EMBED_WARNING = 'This channel is embedding custom content from %link%. Since this content is not trusted, you must click "Embed" below to allow the content to be embedded.<hr>';
window.CustomEmbedPlayer = CustomEmbedPlayer = (function(superClass) {