Advertisement
Guest User

Untitled

a guest
Oct 14th, 2015
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 22.74 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>NoViewsforDrachenLord</title>
  4.     <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  5.     <link rel="icon" href="/favicon.ico" type="image/x-icon">
  6.     <script>
  7.         var streamerID = "DrachenLord_1510";
  8.     </script>
  9.  
  10.     <style type="text/css"/>
  11.     html, body {
  12.         width: 100%;
  13.         height: 100%;
  14.         margin: 0px;
  15.         padding: 0px;
  16.         font-family: Segoe UI, Verdana, Helvecita, sans-serif;
  17.         background: #000;
  18.     }
  19.     div {
  20.         font-family: Segoe UI, Verdana, Helvecita, sans-serif;
  21.     }
  22.     #switcher {
  23.         background: #aebcbf;
  24.         background: -moz-linear-gradient(top, #aebcbf 0%, #6e7774 96%, #0a0809 100%);
  25.         background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#aebcbf), color-stop(96%,#6e7774), color-stop(100%,#0a0809));
  26.         background: -webkit-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
  27.         background: -o-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
  28.         background: -ms-linear-gradient(top, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
  29.         background: linear-gradient(to bottom, #aebcbf 0%,#6e7774 96%,#0a0809 100%);
  30.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aebcbf', endColorstr='#0a0809',GradientType=0 );
  31.         height: 38px;
  32.         width:100%;
  33.     }
  34.     .input {
  35.         float: left;
  36.         color: #222;
  37.     }
  38.     input {
  39.         margin-left: 5px;
  40.         border-top: 1px solid #555;
  41.         border-left: 1px solid #444;
  42.         border-bottom: 1px solid #333;
  43.         border-right: 1px solid #444;
  44.  
  45.         color: #fff;
  46.         padding: 5px;
  47.         height: 25px;
  48.         border-radius: 6px;
  49.         background: #2d2d2d;
  50.         background: -moz-linear-gradient(top, #2d2d2d 5%, #565656 98%);
  51.         background: -webkit-gradient(linear, left top, left bottom, color-stop(5%,#2d2d2d), color-stop(98%,#565656));
  52.         background: -webkit-linear-gradient(top, #2d2d2d 5%,#565656 98%);
  53.         background: -o-linear-gradient(top, #2d2d2d 5%,#565656 98%);
  54.         background: -ms-linear-gradient(top, #2d2d2d 5%,#565656 98%);
  55.         background: linear-gradient(to bottom, #2d2d2d 5%,#565656 98%);
  56.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2d2d2d', endColorstr='#565656',GradientType=0 );
  57.     }
  58.     input[type=button] {
  59.         line-height: 5px;
  60.         background: #565656;
  61.         background: -moz-linear-gradient(top, #565656 2%, #2d2d2d 95%);
  62.         background: -webkit-gradient(linear, left top, left bottom, color-stop(2%,#565656), color-stop(95%,#2d2d2d));
  63.         background: -webkit-linear-gradient(top, #565656 2%,#2d2d2d 95%);
  64.         background: -o-linear-gradient(top, #565656 2%,#2d2d2d 95%);
  65.         background: -ms-linear-gradient(top, #565656 2%,#2d2d2d 95%);
  66.         background: linear-gradient(to bottom, #565656 2%,#2d2d2d 95%);
  67.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#565656', endColorstr='#2d2d2d',GradientType=0 );
  68.     }
  69.     input#streamerID {
  70.         border-right: 0px !important;
  71.         border-top-right-radius: 0px !important;
  72.         border-bottom-right-radius: 0px !important;
  73.     }
  74.     input#connect {
  75.         border-left: 1px #222 !important;
  76.         border-top-left-radius: 0px !important;
  77.         border-bottom-left-radius: 0px !important;
  78.         margin-left: 0px !important;
  79.     }
  80.     #outer {
  81.         height: calc(100% - 38px);
  82.     }
  83.     #switcher .info, #switcher .last {
  84.         height: 27px;
  85.         padding-top: 5px;
  86.         padding-bottom: 5px;
  87.         overflow: hidden;
  88.         float: left;
  89.         border-left: 1px solid #666;
  90.         border-right: 1px solid #888;
  91.         font-size: 10px;
  92.         line-height: 11px;
  93.         padding-left: 8px;
  94.         padding-right: 8px;
  95.     }
  96.     #switcher #connectionInfo {
  97.         font-size: 12px;
  98.         padding-top: 11px;
  99.         padding-bottom: 0px;
  100.         height: 25px;
  101.         font-weight: bold;
  102.     }
  103.     #switcher .last {
  104.         border-right: 0px !important;
  105.         line-height: 11px;
  106.     }
  107.  
  108.     #switcher .right
  109.     {
  110.         float: right;
  111.         margin-top: 5px;
  112.         margin-right: 50px;
  113.         font-size: 18px;
  114.         font-weight: bold;
  115.     }
  116.     .info img, .last img {
  117.         margin-right: 3px;
  118.     }
  119.     #connectionInfo img {
  120.         float: left;
  121.     }
  122.     #chat {
  123.         background: #333;
  124.         width: 350px;
  125.         height: 100%;
  126.         float: right;
  127.     }
  128.     #chat #top {
  129.         height: 20px;
  130.         width: 100%;
  131.         color: #eee;
  132.         background: #444;
  133.         padding: 3px;
  134.     }
  135.     #labelStreamer {
  136.         font-size: 13px;
  137.     }
  138.     #stream {
  139.         float: left;
  140.         width: calc(100% - 350px);
  141.         height: 100%;
  142.     }
  143.     #streamView
  144.     {
  145.         float: left;
  146.         height: calc(100% - 50px);
  147.         width: 100%;
  148.     }
  149.     #streamBar {
  150.         float:left;
  151.         clear:both;
  152.         width: 100%;
  153.         height: 49px;
  154.         background: #666;
  155.         border-top: 1px solid #999;
  156.     }
  157.     #streamBar .left
  158.     {
  159.         float: left;
  160.         margin-left: 10px;
  161.     }
  162.     #streamBar .right
  163.     {
  164.         float: right;
  165.         margin-right: 10px;
  166.     }
  167.  
  168.     #switcher .center{
  169.         float:left;
  170.         width: 71px;
  171.         margin-top: 6px;
  172.     }
  173.  
  174.     #switcher .center2{
  175.         float:left;
  176.         width: 80px;
  177.         margin-top: 6px;
  178.         margin-left: 20px;
  179.         text-align-all: center;
  180.     }
  181.  
  182.     #switcher .center3{
  183.         float:left;
  184.         width: 20px;
  185.         margin-top: 3px;
  186.         margin-left: 20px;
  187.         text-align-all: center;
  188.     }
  189.  
  190.     #switcher .text{
  191.         float: left;
  192.         width: 200px;
  193.         margin-top: 7px;
  194.         margin-left: 7px;
  195.         text-align-all: center;
  196.     }
  197.  
  198.     #streamBar .item {
  199.         float: left;
  200.         font-weight: bold;
  201.         margin: 10px;
  202.         color: #aaa;
  203.     }
  204.     #streamBar img {
  205.         float: left;
  206.         margin-right: 5px;
  207.     }
  208.     #chat ul {
  209.         margin-left: 0px;
  210.         padding-left: 0px;
  211.         height: calc(100% - 10px);
  212.         overflow-y: scroll;
  213.         margin-top: 0px;
  214.         margin-bottom: 0px;
  215.         padding: 5px;
  216.     }
  217.     #chat ul li a {
  218.         color: #eee;
  219.         text-decoration: none;
  220.     }
  221.     #chat ul li {
  222.         font-size: 11px;
  223.         color: #999;
  224.         float: left;
  225.         clear: both;
  226.         margin-left: 5px;
  227.         margin-bottom:5px;
  228.         padding-left: 0px;
  229.     }
  230.     #chat ul li span {
  231.         display: block;
  232.         float: left;
  233.         clear: none;
  234.         width: calc(100% - 60px);
  235.     }
  236.     #chat ul li img {
  237.         margin-right: 5px;
  238.         float: left;
  239.         width: 30px;
  240.         height: 30px;
  241.     }
  242.    
  243.     </style>
  244.  
  245.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  246.     <script src="https://js.pusher.com/2.2/pusher.min.js"></script>
  247.     <script type="text/javascript" src="https://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"></script>
  248. </head>
  249. <body>
  250. <script>
  251.     /*
  252.      ws://ws-younow.pusher.com/app/d5b7447226fc2cd78dbb?protocol=7&client=js&version=2.2.4&flash=false
  253.     }*/
  254. </script>
  255. <div id="switcher">
  256.    <div class="info">
  257.        <div class="input"><span id="labelStreamer"></span> <input type="text" id="streamerID"/></div>
  258.        <div class="input"><input type="button" id="connect"/></div>
  259.    </div>
  260.    <div class="info" id="connectionInfo"></div>
  261.    <div class="last" id="streamerInfo"></div>
  262.    <div class="center"><input type="button" value="Hide Chat" onclick="toogle_chat()"/></div>
  263.    <div class="center2"><input type="button" value="Streaminfo" onclick="streaminfo()"/></div>
  264.    <div class="right">
  265.        <a target="_blank" href="https://kiwiirc.com/client/irc.freenode.net/drachenlord">Haider-Chat</a>
  266.        &nbsp;
  267.         <a target="_blank" href="https://8ch.net/drachenlord/">DrachenChan</a>
  268.     </div>
  269. </div>
  270. <div id="outer">
  271.     <div id="stream">
  272.         <div id="streamView"></div>
  273.         <div id="streamBar"></div>
  274.     </div>
  275.     <div id="chat">
  276.         <ul id="messages">
  277.         </ul>
  278.     </div>
  279. </div>
  280.  
  281. <script>
  282.     var streamerOnline = false;
  283.     var playerOnline = false;
  284.     var firstDone = false;
  285.     var intervalID = -1;
  286.     var YouNowPlayer = function () {
  287.         this.language = this.config["language"]["de_DE"];
  288.         $('#labelStreamer').html(this.language["streamer"]);
  289.         $('#connect').val(this.language["connect"]);
  290.         this.disconnected();
  291.         var self = this;
  292.         setInterval(function () {
  293.             self.tick();
  294.         }, 1000);
  295.     };
  296.     YouNowPlayer.prototype.connect = function (streamerID, mode) {
  297.         this.disconnect();
  298.         $('#connectionInfo').html('<img src="' + this.config["icons"]["disconnected"] + '" />' + this.language["connecting"]);
  299.         var self = this;
  300.         $.ajax({
  301.             url: 'https://www.younow.com/php/api/broadcast/info/channelId=12681330/curId=0',
  302.             jsonp: "callback",
  303.             dataType: "jsonp",
  304.             success: function (json, b, c) {
  305.                 if (json["errorCode"] > 0 && mode == 0) {
  306.                    self.failed("(" + json["errorCode"] + ") " + streamerID + " ist etzala gerad uff Arbeit und ned am screamen.");
  307.                     streamerOnline = false;
  308.                 } else if (json["errorCode"] > 0 && mode == 1) {
  309.                    console.log("Streamer not online");
  310.                     streamerOnline = false;
  311.                     playerOnline = false;
  312.                     firstDone = true;
  313.                 }
  314.                 else {
  315.                     firstDone = true;
  316.                     streamerOnline = true;
  317.                     playerOnline = true;
  318.                     self.connected(json);
  319.                 }
  320.             }
  321.         });
  322.     };
  323.     YouNowPlayer.prototype.disconnect = function () {
  324.         if (this.pusher != null)
  325.             this.pusher.disconnect();
  326.         this.disconnected();
  327.         playerOnline = false;
  328.     };
  329.     YouNowPlayer.prototype.disconnected = function () {
  330.         $('#messages').html("");
  331.         $('#streamView').html("");
  332.         $('#streamBar').html("");
  333.         $('#connectionInfo').html('<img src="' + this.config["icons"]["disconnected"] + '" />' + this.language["disconnected"]);
  334.         $('#streamerInfo').html("");
  335.         $('#top').html("");
  336.         this.isConnected = false;
  337.     };
  338.     YouNowPlayer.prototype.streamerData = {};
  339.     YouNowPlayer.prototype.connected = function (streamerData) {
  340.         $('#connectionInfo').html('<img src="' + this.config["icons"]["connected"] + '" />' + this.language["connected"]);
  341.         this.streamerData = streamerData;
  342.         console.log(this.streamerData);
  343.  
  344.         var d = new Date();
  345.         this.timeStart = d.getTime();
  346.         this.duration = this.streamerData.length;
  347.  
  348.         this.isConnected = true;
  349.         this.tick();
  350.         try {
  351.         var temp = this.streamerData.media.stream;
  352.         } catch(e){
  353.             currentPlayer.disconnect();
  354.             console.log("Error Stream not rly online yet, trying to reconnect");
  355.             clearInterval(intervalID);
  356.             checkIfOnline();
  357.             return;
  358.         }
  359.  
  360.         flowplayer("streamView", "https://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
  361.             clip: {
  362.                 url: this.streamerData.media.stream,
  363.                 live: true,
  364.                 scaling: 'fit',
  365.                 provider: 'rtmp'
  366.             },
  367.             plugins: {
  368.                 rtmp: {
  369.                     url: "flowplayer.rtmp-3.2.13.swf",
  370.                     netConnectionUrl: 'rtmp://' + this.streamerData.media.host + this.streamerData.media.app
  371.                 },
  372.                 controls: {
  373.                     all: false,
  374.                     play: false,
  375.                     scrubber: false,
  376.                     mute: true,
  377.                     volume: true,
  378.                     fullscreen: true
  379.                 }
  380.             },
  381.             canvas: {
  382.                 backgroundGradient: 'none'
  383.             }
  384.         });
  385.         this.pusher = new Pusher('d5b7447226fc2cd78dbb', {cluster: "younow"});
  386.         this.channel = this.pusher.subscribe("public-channel_" + this.streamerData.userId);
  387.         var self = this;
  388.         this.channel.bind('onLikes', function (data) {
  389.             self.streamerData.likes = data.message.likes;
  390.             self.streamerData.viewers = data.message.viewers;
  391.         });
  392.         this.channel.bind('onViewers', function (data) {
  393.             self.streamerData.likes = data.message.likes;
  394.             self.streamerData.viewers = data.message.viewers;
  395.         });
  396.         this.channel.bind('onChat', function (data) {
  397.             for (i = 0; i < data.message.comments.length; i++)
  398.                self.addChatMessage(data.message.comments[i]);
  399.        });
  400.    };
  401.    YouNowPlayer.prototype.addChatMessage = function (message) {
  402.        var wasBottom = false;
  403.        if ($("#messages").scrollTop() > $("#messages")[0].scrollHeight - $("#messages").height() - 20)
  404.             wasBottom = true;
  405.         if ($('#messages').children().length > this.config.maxMessages - 1)
  406.             $('#messages').children()[0].remove();
  407.         $('#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>');
  408.         if (wasBottom) {
  409.             $("#messages").animate({scrollTop: $("#messages")[0].scrollHeight}, 200)
  410.         }
  411.     };
  412.     YouNowPlayer.prototype.updateInfo = function () {
  413.         var socialMedia = "";
  414.         if (this.streamerData.user["facebookId"] != null)
  415.             socialMedia += "<a href=\"https://www.facebook.com/" + this.streamerData.user.facebookId + "\"><img src=\"" + this.config.icons.facebook + "\"></a>";
  416.         if (this.streamerData.user["facebookUrl"] != null)
  417.             socialMedia += "<a href=\"" + this.streamerData.user.facebookUrl + "\"><img src=\"" + this.config.icons.facebook + "\"></a>";
  418.         if (this.streamerData.user["twitterHandle"] != null)
  419.             socialMedia += "<a href=\"https://www.twitter.com/" + this.streamerData.user.twitterHandle + "\"><img src=\"" + this.config.icons.twitter + "\"></a>";
  420.         if (this.streamerData.user["youTubeUserName"] != null)
  421.             socialMedia += "<a href=\"https://www.youtube.com/" + this.streamerData.user.youTubeUserName + "\"><img src=\"" + this.config.icons.youtube + "\"></a>";
  422.         $('#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;\">" + "&nbsp&nbsp&nbsp"+  "<strong>" + this.language["chatlvl"] +": "+ this.streamerData.minChatLevel + "</strong></span></div> ");
  423.         //$('#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> ");
  424.  
  425.         $('#top').html(this.streamerData.viewers + " " + this.language["viewers"]);
  426.         var hours = Math.floor(this.duration / (60 * 60));
  427.         var minutes = Math.floor(this.duration / (60)) % 60;
  428.         var seconds = this.duration % 60;
  429.         var time = "";
  430.         if (hours > 0) time += hours + ":";
  431.         if (minutes > 9) time += minutes + ":";
  432.         else time += "0" + minutes + ":";
  433.         if (seconds > 9) time += seconds;
  434.         else time += "0" + seconds;
  435.         $('#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>");
  436.     }
  437.     YouNowPlayer.prototype.failed = function (error) {
  438.         this.disconnected();
  439.         alert(error);
  440.     };
  441.     YouNowPlayer.prototype.tick = function () {
  442.         if (this.isConnected) {
  443.             var d = new Date();
  444.             this.duration = this.streamerData.length + Math.floor((d.getTime() - this.timeStart) / 1000);
  445.             console.log("Update Info");
  446.             this.updateInfo();
  447.         }
  448.     };
  449.     YouNowPlayer.prototype.isConnected = false;
  450.     YouNowPlayer.prototype.config = {
  451.         maxMessages: 200,
  452.         icons: {
  453.             "disconnected": "icons/disconnect.png",
  454.             "connected": "icons/connect.png",
  455.             "youtube": "icons/yt.png",
  456.             "facebook": "icons/facebook.png",
  457.             "twitter": "icons/twitter.png",
  458.             "googleplus": "icons/gplus.png",
  459.             "bars": "icons/icon_bar_sm.png",
  460.             "coins": "icons/menu_user_coins1.png",
  461.             "views": "icons/eye-icon.png",
  462.             "time": "icons/clock.png",
  463.             "likes": "icons/thumbs_up.png",
  464.             "shares": "icons/megaphone.png"
  465.         },
  466.         language: {
  467.             "de_DE": {
  468.                 "disconnected": "Nicht verbunden",
  469.                 "connecting": "Verbinden...",
  470.                 "connected": "Verbunden",
  471.                 "connect": "Verbinden",
  472.                 "streamer": "Streamer:",
  473.                 "to": "bis",
  474.                 "in": "in",
  475.                 "chat": "Chat",
  476.                 "users": "Benutzer",
  477.                 "viewers": "Zuschauer",
  478.                 "moderators": "Moderator(en)",
  479.                 "shares": "Teilung(en)",
  480.                 "likes": "Like(s)",
  481.                 "chatlvl": "Chat-Level"
  482.             }
  483.         }
  484.     };
  485.     var currentPlayer = null;
  486.     $(document).ready(function () {
  487.         currentPlayer = new YouNowPlayer();
  488.         $('#streamerID').val(streamerID);
  489.         $('#connect').click(function () {
  490.             currentPlayer.connect($('#streamerID').val(), 0);
  491.         });
  492.     });
  493.     function toogle_chat() {
  494.         if ($('#chat').width() == 0) {
  495.             $('#footer2').css("background-color", "#333");
  496.             $('#chat').show();
  497.             $('#chat').width(350);
  498.             $('#stream').position("left");
  499.             var newWidth = ( $(window).width() - 355);
  500.             $('#stream').width(newWidth);
  501.             $('#stream').position("left");
  502.         } else {
  503.             $('#footer2').css("background-color", "#666");
  504.             $('#chat').hide();
  505.             $('#chat').width(0);
  506.             $('#stream').width("100%");
  507.         }
  508.  
  509.     }
  510.  
  511.     function Reconnect() {
  512.         currentPlayer = new YouNowPlayer();
  513.         currentPlayer.connect($('#streamerID').val(), 1);
  514.     }
  515.     function switchModus() {
  516.         if ($('#reconnectCheckbox').prop('checked')) {
  517.             checkIfOnline();
  518.         }
  519.         if (!$('#reconnectCheckbox').prop('checked')) {
  520.             console.log("INTERVALL CLEARED: " + intervalID);
  521.             clearInterval(intervalID);
  522.         }
  523.     }
  524.     function getStreamerStatus() {
  525.         var self = this;
  526.         streamerID = $('#streamerID').val();
  527.         console.log("StreamerID: "+streamerID);
  528.         console.log(" ");
  529.         $.ajax({
  530.             url: 'https://www.younow.com/php/api/broadcast/info/curId=0/user=' + streamerID,
  531.             jsonp: "callback",
  532.             dataType: "jsonp",
  533.             success: function (json, b, c) {
  534.                 if (json["errorCode"] > 0) {
  535.                     streamerOnline = false;
  536.                 } else {
  537.                     streamerOnline = true;
  538.                 }
  539.             }
  540.         });
  541.     }
  542.  
  543.     function checkIfOnline() {
  544.         if (!firstDone) {
  545.             firstDone = true;
  546.         }
  547.         if ($('#reconnectCheckbox').prop('checked')) {
  548.             intervalID = setInterval(function () {
  549.                 console.log("PlayerStatus:" + playerOnline);
  550.                 if (streamerOnline && !playerOnline) {
  551.                    Reconnect();
  552.                 } else if (playerOnline && !streamerOnline) {
  553.                    console.log("StreamerStatus:" + streamerOnline);
  554.                     currentPlayer.disconnect();
  555.                 } else {
  556.                     console.log("StreamerStatus:" + streamerOnline);
  557.                 }
  558.                 getStreamerStatus()
  559.             }, 5000);
  560.         }
  561.     }
  562.     checkIfOnline();
  563.    
  564.     function streaminfo () {
  565.         w = 900
  566.         h = 250
  567.         x = screen.availWidth/2-w/2;
  568.         y = screen.availHeight/2-h/2;
  569.         var popupWindow = window.open('','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
  570.         var self = this;
  571.         streamerID = $('#streamerID').val();
  572.         $.ajax({
  573.             url: 'https://www.younow.com/php/api/broadcast/info/curId=0/user=' + streamerID,
  574.             jsonp: "callback",
  575.             dataType: "jsonp",
  576.             success: function (json, b, c) {
  577.                 if (json["errorCode"] > 0) {
  578.                     //streamerOnline = false;
  579.                     popupWindow.document.write("<html><body bgcolor=\"#666\"> Streamer offline</html>");
  580.                 } else {
  581.                     //streamerOnline = true;
  582.                     popupWindow.document.write(
  583.                     "<html><body bgcolor=\"#666\">" +
  584.                     "User-ID: " + json.userId + "<br />" +
  585.                     "Chat-Level: " + json.minChatLevel + "<br />" +
  586.                     "Age: " + json.age + "<br />" +
  587.                     "Max Likes: " + json.maxLikesInBroadcast + "<br />" +
  588.                     "Fans: " + json.totalFans + "<br />" +
  589.                     "Partner: " + json.partner + "<br />" +
  590.                     "Broadcast-Info: " + "<br />" + json.broadcasterInfo + "<br />" +
  591.                     "Stream-URL: " + "<br />" + "rtmp://" + json.media.host + json.media.app + "/" + json.media.stream + "<br />" +
  592.                     "<html>"
  593.                     );
  594.                 }
  595.             }
  596.         });
  597.        
  598.     }
  599.  
  600. </script>
  601. </body>
  602. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement