Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>NoViewsforDrachenLord</title>
- <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
- <link rel="icon" href="/favicon.ico" type="image/x-icon">
- <script>
- var streamerID = "DrachenLord_1510";
- </script>
- <style type="text/css"/>
- html, body {
- width: 100%;
- height: 100%;
- margin: 0px;
- padding: 0px;
- font-family: Segoe UI, Verdana, Helvecita, sans-serif;
- background: #000;
- }
- div {
- font-family: Segoe UI, Verdana, Helvecita, sans-serif;
- }
- #switcher {
- background: #aebcbf;
- background: -moz-linear-gradient(top, #aebcbf 0%, #6e7774 96%, #0a0809 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#aebcbf), color-stop(96%,#6e7774), color-stop(100%,#0a0809));
- background: -webkit-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
- background: -o-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
- background: -ms-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
- background: linear-gradient(to bottom, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aebcbf', endColorstr='#0a0809',GradientType=0 );
- height: 38px;
- width:100%;
- }
- .input {
- float: left;
- color: #222;
- }
- input {
- margin-left: 5px;
- border-top: 1px solid #555;
- border-left: 1px solid #444;
- border-bottom: 1px solid #333;
- border-right: 1px solid #444;
- color: #fff;
- padding: 5px;
- height: 25px;
- border-radius: 6px;
- background: #2d2d2d;
- background: -moz-linear-gradient(top, #2d2d2d 5%, #565656 98%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(5%,#2d2d2d), color-stop(98%,#565656));
- background: -webkit-linear-gradient(top, #2d2d2d 5%,#565656 98%);
- background: -o-linear-gradient(top, #2d2d2d 5%,#565656 98%);
- background: -ms-linear-gradient(top, #2d2d2d 5%,#565656 98%);
- background: linear-gradient(to bottom, #2d2d2d 5%,#565656 98%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2d2d2d', endColorstr='#565656',GradientType=0 );
- }
- input[type=button] {
- line-height: 5px;
- background: #565656;
- background: -moz-linear-gradient(top, #565656 2%, #2d2d2d 95%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(2%,#565656), color-stop(95%,#2d2d2d));
- background: -webkit-linear-gradient(top, #565656 2%,#2d2d2d 95%);
- background: -o-linear-gradient(top, #565656 2%,#2d2d2d 95%);
- background: -ms-linear-gradient(top, #565656 2%,#2d2d2d 95%);
- background: linear-gradient(to bottom, #565656 2%,#2d2d2d 95%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#565656', endColorstr='#2d2d2d',GradientType=0 );
- }
- input#streamerID {
- border-right: 0px !important;
- border-top-right-radius: 0px !important;
- border-bottom-right-radius: 0px !important;
- }
- input#connect {
- border-left: 1px #222 !important;
- border-top-left-radius: 0px !important;
- border-bottom-left-radius: 0px !important;
- margin-left: 0px !important;
- }
- #outer {
- height: calc(100% - 38px);
- }
- #switcher .info, #switcher .last {
- height: 27px;
- padding-top: 5px;
- padding-bottom: 5px;
- overflow: hidden;
- float: left;
- border-left: 1px solid #666;
- border-right: 1px solid #888;
- font-size: 10px;
- line-height: 11px;
- padding-left: 8px;
- padding-right: 8px;
- }
- #switcher #connectionInfo {
- font-size: 12px;
- padding-top: 11px;
- padding-bottom: 0px;
- height: 25px;
- font-weight: bold;
- }
- #switcher .last {
- border-right: 0px !important;
- line-height: 11px;
- }
- #switcher .right
- {
- float: right;
- margin-top: 5px;
- margin-right: 50px;
- font-size: 18px;
- font-weight: bold;
- }
- .info img, .last img {
- margin-right: 3px;
- }
- #connectionInfo img {
- float: left;
- }
- #chat {
- background: #333;
- width: 350px;
- height: 100%;
- float: right;
- }
- #chat #top {
- height: 20px;
- width: 100%;
- color: #eee;
- background: #444;
- padding: 3px;
- }
- #labelStreamer {
- font-size: 13px;
- }
- #stream {
- float: left;
- width: calc(100% - 350px);
- height: 100%;
- }
- #streamView
- {
- float: left;
- height: calc(100% - 50px);
- width: 100%;
- }
- #streamBar {
- float:left;
- clear:both;
- width: 100%;
- height: 49px;
- background: #666;
- border-top: 1px solid #999;
- }
- #streamBar .left
- {
- float: left;
- margin-left: 10px;
- }
- #streamBar .right
- {
- float: right;
- margin-right: 10px;
- }
- #switcher .center{
- float:left;
- width: 71px;
- margin-top: 6px;
- }
- #switcher .center2{
- float:left;
- width: 80px;
- margin-top: 6px;
- margin-left: 20px;
- text-align-all: center;
- }
- #switcher .center3{
- float:left;
- width: 20px;
- margin-top: 3px;
- margin-left: 20px;
- text-align-all: center;
- }
- #switcher .text{
- float: left;
- width: 200px;
- margin-top: 7px;
- margin-left: 7px;
- text-align-all: center;
- }
- #streamBar .item {
- float: left;
- font-weight: bold;
- margin: 10px;
- color: #aaa;
- }
- #streamBar img {
- float: left;
- margin-right: 5px;
- }
- #chat ul {
- margin-left: 0px;
- padding-left: 0px;
- height: calc(100% - 10px);
- overflow-y: scroll;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 5px;
- }
- #chat ul li a {
- color: #eee;
- text-decoration: none;
- }
- #chat ul li {
- font-size: 11px;
- color: #999;
- float: left;
- clear: both;
- margin-left: 5px;
- margin-bottom:5px;
- padding-left: 0px;
- }
- #chat ul li span {
- display: block;
- float: left;
- clear: none;
- width: calc(100% - 60px);
- }
- #chat ul li img {
- margin-right: 5px;
- float: left;
- width: 30px;
- height: 30px;
- }
- </style>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
- <script src="https://js.pusher.com/2.2/pusher.min.js"></script>
- <script type="text/javascript" src="https://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>
- </head>
- <body>
- <script>
- /*
- ws://ws-younow.pusher.com/app/d5b7447226fc2cd78dbb?protocol=7&client=js&version=2.2.4&flash=false
- }*/
- </script>
- <div id="switcher">
- <div class="info">
- <div class="input"><span id="labelStreamer"></span> <input type="text" id="streamerID"/></div>
- <div class="input"><input type="button" id="connect"/></div>
- </div>
- <div class="info" id="connectionInfo"></div>
- <div class="last" id="streamerInfo"></div>
- <div class="center"><input type="button" value="Hide Chat" onclick="toogle_chat()"/></div>
- <div class="center2"><input type="button" value="Streaminfo" onclick="streaminfo()"/></div>
- <div class="right">
- <a target="_blank" href="https://kiwiirc.com/client/irc.freenode.net/drachenlord">Haider-Chat</a>
-
- <a target="_blank" href="https://8ch.net/drachenlord/">DrachenChan</a>
- </div>
- </div>
- <div id="outer">
- <div id="stream">
- <div id="streamView"></div>
- <div id="streamBar"></div>
- </div>
- <div id="chat">
- <ul id="messages">
- </ul>
- </div>
- </div>
- <script>
- var streamerOnline = false;
- var playerOnline = false;
- var firstDone = false;
- var intervalID = -1;
- var YouNowPlayer = function () {
- this.language = this.config["language"]["de_DE"];
- $('#labelStreamer').html(this.language["streamer"]);
- $('#connect').val(this.language["connect"]);
- this.disconnected();
- var self = this;
- setInterval(function () {
- self.tick();
- }, 1000);
- };
- YouNowPlayer.prototype.connect = function (streamerID, mode) {
- this.disconnect();
- $('#connectionInfo').html('<img src="' + this.config["icons"]["disconnected"] + '" />' + this.language["connecting"]);
- var self = this;
- $.ajax({
- url: 'https://www.younow.com/php/api/broadcast/info/channelId=12681330/curId=0',
- jsonp: "callback",
- dataType: "jsonp",
- success: function (json, b, c) {
- if (json["errorCode"] > 0 && mode == 0) {
- self.failed("(" + json["errorCode"] + ") " + streamerID + " ist etzala gerad uff Arbeit und ned am screamen.");
- streamerOnline = false;
- } else if (json["errorCode"] > 0 && mode == 1) {
- console.log("Streamer not online");
- streamerOnline = false;
- playerOnline = false;
- firstDone = true;
- }
- else {
- firstDone = true;
- streamerOnline = true;
- playerOnline = true;
- self.connected(json);
- }
- }
- });
- };
- YouNowPlayer.prototype.disconnect = function () {
- if (this.pusher != null)
- this.pusher.disconnect();
- this.disconnected();
- playerOnline = false;
- };
- YouNowPlayer.prototype.disconnected = function () {
- $('#messages').html("");
- $('#streamView').html("");
- $('#streamBar').html("");
- $('#connectionInfo').html('<img src="' + this.config["icons"]["disconnected"] + '" />' + this.language["disconnected"]);
- $('#streamerInfo').html("");
- $('#top').html("");
- this.isConnected = false;
- };
- YouNowPlayer.prototype.streamerData = {};
- YouNowPlayer.prototype.connected = function (streamerData) {
- $('#connectionInfo').html('<img src="' + this.config["icons"]["connected"] + '" />' + this.language["connected"]);
- this.streamerData = streamerData;
- console.log(this.streamerData);
- var d = new Date();
- this.timeStart = d.getTime();
- this.duration = this.streamerData.length;
- this.isConnected = true;
- this.tick();
- try {
- var temp = this.streamerData.media.stream;
- } catch(e){
- currentPlayer.disconnect();
- console.log("Error Stream not rly online yet, trying to reconnect");
- clearInterval(intervalID);
- checkIfOnline();
- return;
- }
- flowplayer("streamView", "https://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
- clip: {
- url: this.streamerData.media.stream,
- live: true,
- scaling: 'fit',
- provider: 'rtmp'
- },
- plugins: {
- rtmp: {
- url: "flowplayer.rtmp-3.2.13.swf",
- netConnectionUrl: 'rtmp://' + this.streamerData.media.host + this.streamerData.media.app
- },
- controls: {
- all: false,
- play: false,
- scrubber: false,
- mute: true,
- volume: true,
- fullscreen: true
- }
- },
- canvas: {
- backgroundGradient: 'none'
- }
- });
- this.pusher = new Pusher('d5b7447226fc2cd78dbb', {cluster: "younow"});
- this.channel = this.pusher.subscribe("public-channel_" + this.streamerData.userId);
- var self = this;
- this.channel.bind('onLikes', function (data) {
- self.streamerData.likes = data.message.likes;
- self.streamerData.viewers = data.message.viewers;
- });
- this.channel.bind('onViewers', function (data) {
- self.streamerData.likes = data.message.likes;
- self.streamerData.viewers = data.message.viewers;
- });
- this.channel.bind('onChat', function (data) {
- for (i = 0; i < data.message.comments.length; i++)
- self.addChatMessage(data.message.comments[i]);
- });
- };
- YouNowPlayer.prototype.addChatMessage = function (message) {
- var wasBottom = false;
- if ($("#messages").scrollTop() > $("#messages")[0].scrollHeight - $("#messages").height() - 20)
- wasBottom = true;
- if ($('#messages').children().length > this.config.maxMessages - 1)
- $('#messages').children()[0].remove();
- $('#messages').append('<li><img src="https://cdn2.younow.com/php/api/channel/getImage/?channelId=' + message.userId + '" height="30" /><span><strong><a href="https://www.younow.com/' + message.profileUrlString + '">' + message.name + ' (' + message.userLevel + ')</a>: </strong>' + message.comment + '</span></li>');
- if (wasBottom) {
- $("#messages").animate({scrollTop: $("#messages")[0].scrollHeight}, 200)
- }
- };
- YouNowPlayer.prototype.updateInfo = function () {
- var socialMedia = "";
- if (this.streamerData.user["facebookId"] != null)
- socialMedia += "<a href=\"https://www.facebook.com/" + this.streamerData.user.facebookId + "\"><img src=\"" + this.config.icons.facebook + "\"></a>";
- if (this.streamerData.user["facebookUrl"] != null)
- socialMedia += "<a href=\"" + this.streamerData.user.facebookUrl + "\"><img src=\"" + this.config.icons.facebook + "\"></a>";
- if (this.streamerData.user["twitterHandle"] != null)
- socialMedia += "<a href=\"https://www.twitter.com/" + this.streamerData.user.twitterHandle + "\"><img src=\"" + this.config.icons.twitter + "\"></a>";
- if (this.streamerData.user["youTubeUserName"] != null)
- socialMedia += "<a href=\"https://www.youtube.com/" + this.streamerData.user.youTubeUserName + "\"><img src=\"" + this.config.icons.youtube + "\"></a>";
- $('#streamerInfo').html("<img style=\"float:left;\" height=\"28\" src=\"https://cdn2.younow.com/php/api/channel/getImage/?channelId=" + this.streamerData['userId'] + "\" />" + this.streamerData.country + " | <strong>" + this.streamerData.username + "</strong> (" + this.streamerData.user.userLevel + " | " + (Math.round((this.streamerData.userlevel % 1) * 100)) + "% " + this.language["to"] + " " + (this.streamerData.user.userLevel + 1) + ") " + this.language["in"] + " #" +this.streamerData.tags + "<br /><div style=\"float:left;\">" + socialMedia + "</div><div style=\"float:left;\"><img style=\"float:left;\" height=\"16\" src=\"" + this.config.icons.coins + "\"><span style=\"margin-top:3px;float:left;\">" + this.streamerData.coins + "</span></div> <div style=\"margin-top:3px; float:left;\">" + "   "+ "<strong>" + this.language["chatlvl"] +": "+ this.streamerData.minChatLevel + "</strong></span></div> ");
- //$('#streamerInfo').html("<img style=\"float:left;\" height=\"28\" src=\"https://cdn2.younow.com/php/api/channel/getImage/?channelId=" + this.streamerData['userId'] + "\" />" + this.streamerData.country + " | <strong>" + this.streamerData.username + "</strong> (" + this.streamerData.user.userLevel + " | " + (Math.round((this.streamerData.userlevel % 1) * 100)) + "% " + this.language["to"] + " " + (this.streamerData.user.userLevel + 1) + ") " + this.language["in"] + " #deutsch" + "<br /><div style=\"float:left;\">" + socialMedia + "</div><div style=\"float:left;\"><img style=\"float:left;\" height=\"16\" src=\"" + this.config.icons.coins + "\"><span style=\"margin-top:3px;float:left;\">" + this.streamerData.coins + "</span></div> <div style=\"margin-left:5px; float:left;\"><img style=\"float:left;\" height=\"16\" src=\"" + this.config.icons.bars + "\"><span style=\"margin-top:3px;float:left;\">" + this.streamerData.barsEarned + "</span></div> ");
- $('#top').html(this.streamerData.viewers + " " + this.language["viewers"]);
- var hours = Math.floor(this.duration / (60 * 60));
- var minutes = Math.floor(this.duration / (60)) % 60;
- var seconds = this.duration % 60;
- var time = "";
- if (hours > 0) time += hours + ":";
- if (minutes > 9) time += minutes + ":";
- else time += "0" + minutes + ":";
- if (seconds > 9) time += seconds;
- else time += "0" + seconds;
- $('#streamBar').html("<div class=\"left\"><div class=\"item\"><img src=\"" + this.config.icons.likes + "\" />" + this.streamerData.likes + "</div><div class=\"item\"><img src=\"" + this.config.icons.shares + "\" />" + this.streamerData.shares + "</div></div></div><div class=\"right\"><div class=\"item\"><img src=\"" + this.config.icons.time + "\" />" + time + "</div><div class=\"item\"><img src=\"" + this.config.icons.views + "\" />" + this.streamerData.viewers + "</div></div>");
- }
- YouNowPlayer.prototype.failed = function (error) {
- this.disconnected();
- alert(error);
- };
- YouNowPlayer.prototype.tick = function () {
- if (this.isConnected) {
- var d = new Date();
- this.duration = this.streamerData.length + Math.floor((d.getTime() - this.timeStart) / 1000);
- console.log("Update Info");
- this.updateInfo();
- }
- };
- YouNowPlayer.prototype.isConnected = false;
- YouNowPlayer.prototype.config = {
- maxMessages: 200,
- icons: {
- "disconnected": "icons/disconnect.png",
- "connected": "icons/connect.png",
- "youtube": "icons/yt.png",
- "facebook": "icons/facebook.png",
- "twitter": "icons/twitter.png",
- "googleplus": "icons/gplus.png",
- "bars": "icons/icon_bar_sm.png",
- "coins": "icons/menu_user_coins1.png",
- "views": "icons/eye-icon.png",
- "time": "icons/clock.png",
- "likes": "icons/thumbs_up.png",
- "shares": "icons/megaphone.png"
- },
- language: {
- "de_DE": {
- "disconnected": "Nicht verbunden",
- "connecting": "Verbinden...",
- "connected": "Verbunden",
- "connect": "Verbinden",
- "streamer": "Streamer:",
- "to": "bis",
- "in": "in",
- "chat": "Chat",
- "users": "Benutzer",
- "viewers": "Zuschauer",
- "moderators": "Moderator(en)",
- "shares": "Teilung(en)",
- "likes": "Like(s)",
- "chatlvl": "Chat-Level"
- }
- }
- };
- var currentPlayer = null;
- $(document).ready(function () {
- currentPlayer = new YouNowPlayer();
- $('#streamerID').val(streamerID);
- $('#connect').click(function () {
- currentPlayer.connect($('#streamerID').val(), 0);
- });
- });
- function toogle_chat() {
- if ($('#chat').width() == 0) {
- $('#footer2').css("background-color", "#333");
- $('#chat').show();
- $('#chat').width(350);
- $('#stream').position("left");
- var newWidth = ( $(window).width() - 355);
- $('#stream').width(newWidth);
- $('#stream').position("left");
- } else {
- $('#footer2').css("background-color", "#666");
- $('#chat').hide();
- $('#chat').width(0);
- $('#stream').width("100%");
- }
- }
- function Reconnect() {
- currentPlayer = new YouNowPlayer();
- currentPlayer.connect($('#streamerID').val(), 1);
- }
- function switchModus() {
- if ($('#reconnectCheckbox').prop('checked')) {
- checkIfOnline();
- }
- if (!$('#reconnectCheckbox').prop('checked')) {
- console.log("INTERVALL CLEARED: " + intervalID);
- clearInterval(intervalID);
- }
- }
- function getStreamerStatus() {
- var self = this;
- streamerID = $('#streamerID').val();
- console.log("StreamerID: "+streamerID);
- console.log(" ");
- $.ajax({
- url: 'https://www.younow.com/php/api/broadcast/info/curId=0/user=' + streamerID,
- jsonp: "callback",
- dataType: "jsonp",
- success: function (json, b, c) {
- if (json["errorCode"] > 0) {
- streamerOnline = false;
- } else {
- streamerOnline = true;
- }
- }
- });
- }
- function checkIfOnline() {
- if (!firstDone) {
- firstDone = true;
- }
- if ($('#reconnectCheckbox').prop('checked')) {
- intervalID = setInterval(function () {
- console.log("PlayerStatus:" + playerOnline);
- if (streamerOnline && !playerOnline) {
- Reconnect();
- } else if (playerOnline && !streamerOnline) {
- console.log("StreamerStatus:" + streamerOnline);
- currentPlayer.disconnect();
- } else {
- console.log("StreamerStatus:" + streamerOnline);
- }
- getStreamerStatus()
- }, 5000);
- }
- }
- checkIfOnline();
- function streaminfo () {
- w = 900
- h = 250
- x = screen.availWidth/2-w/2;
- y = screen.availHeight/2-h/2;
- var popupWindow = window.open('','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
- var self = this;
- streamerID = $('#streamerID').val();
- $.ajax({
- url: 'https://www.younow.com/php/api/broadcast/info/curId=0/user=' + streamerID,
- jsonp: "callback",
- dataType: "jsonp",
- success: function (json, b, c) {
- if (json["errorCode"] > 0) {
- //streamerOnline = false;
- popupWindow.document.write("<html><body bgcolor=\"#666\"> Streamer offline</html>");
- } else {
- //streamerOnline = true;
- popupWindow.document.write(
- "<html><body bgcolor=\"#666\">" +
- "User-ID: " + json.userId + "<br />" +
- "Chat-Level: " + json.minChatLevel + "<br />" +
- "Age: " + json.age + "<br />" +
- "Max Likes: " + json.maxLikesInBroadcast + "<br />" +
- "Fans: " + json.totalFans + "<br />" +
- "Partner: " + json.partner + "<br />" +
- "Broadcast-Info: " + "<br />" + json.broadcasterInfo + "<br />" +
- "Stream-URL: " + "<br />" + "rtmp://" + json.media.host + json.media.app + "/" + json.media.stream + "<br />" +
- "<html>"
- );
- }
- }
- });
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement