Skip to content

Instantly share code, notes, and snippets.

@kuntau
Last active October 27, 2016 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuntau/cb41bc069d869b5aa29b533b437db0ec to your computer and use it in GitHub Desktop.
Save kuntau/cb41bc069d869b5aa29b533b437db0ec to your computer and use it in GitHub Desktop.
Browser Popup
angular.module("trackerApp").directive("stream", ["$sce", "$rootScope", function(a, b) {
return {
restrict: "E",
templateUrl: "views/match_stream.html",
scope: !1,
transclude: !1,
controller: ["$scope", function(c) {
c.trustTwitchSrc = function(b) {
return a.trustAsResourceUrl("http://twitch.tv/" + b + "/embed")
}
,
c.trustHitboxSrc = function(b) {
return a.trustAsResourceUrl("http://hitbox.tv/#!/embed/" + b + "?autoplay=true")
}
,
c.trustDouyuSrc = function(b) {
return a.trustAsResourceUrl("http://staticlive.douyutv.com/common/share/play.swf?room_id=" + b)
}
,
c.trustMixlrSrc = function(b) {
return a.trustAsResourceUrl("http://s3.amazonaws.com/mixlr-assets.s3.amazonaws.com/player2.0.swf?ae=" + b)
}
,
c.trustHuomaoSrc = function(b) {
return a.trustAsResourceUrl("http://www.huomaotv.com/index.php?c=outplayer&live_id=" + b)
}
,
c.trustMlgSrc = function(b) {
return a.trustAsResourceUrl("http://www.majorleaguegaming.com/player/embed/" + b)
}
,
c.trustAzubuSrc = function(b) {
return a.trustAsResourceUrl("http://embed.azubu.tv/" + b)
}
,
c.trustYoutubeSrc = function(b) {
return a.trustAsResourceUrl("https://www.youtube.com/embed/" + b)
}
,
c.popout = function(a, d) {
"twitch" == d && window.open(c.trustTwitchSrc(a), "Twitch", "width=800,height=450,toolbar=0,menubar=0,scrollbars=0,resizeable=1"),
"hitbox" == d && window.open(c.trustHitboxSrc(a), "Hitbox", "width=800,height=450,toolbar=0,menubar=0,scrollbars=0,resizeable=1"),
"huomao" == d && window.open(c.trustHuomaoSrc(a), "Huomao", "width=800,height=450,toolbar=0,menubar=0,scrollbars=0,resizeable=1"),
b.small_stream = !1,
b.large_stream = !1,
b.stream = null
}
,
c.chatPopout = function(a, b) {
"twitch" == b && window.open("http://twitch.tv/" + a + "/chat", "Twitch", "width=400,height=800,toolbar=0,menubar=0,scrollbars=0,resizeable=1"),
"hitbox" == b && window.open("http://hitbox.tv/#!/embedchat/" + a, "Hitbox", "width=400,height=800,toolbar=0,menubar=0,scrollbars=0,resizeable=1")
}
}
]
}
}
])
stream.popout("https://twitch.tv/beyondthesummit/embed")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment