| 1234567891011121314151617181920212223242526 |
- <div id="bx-stream-viewers-__suffix__" class="bx-stream-viewers">__viewers__</div>
- <script>
- var fFunc = function () {
- let playerInstance = typeof(OvenPlayer) === 'undefined' ? false : OvenPlayer.getPlayerByContainerId("bx-stream-player-__suffix__");
- if ((!playerInstance || 'playing' == playerInstance.getState() || 'idle' == playerInstance.getState()) && ('undefined' !== typeof(document.hidden) && !document.hidden)) {
- $.getJSON('__url__', function (oData) {
- if ('undefined' !== typeof(oData.viewers)) {
- $('#bx-stream-viewers-__suffix__').html(oData.viewers);
- }
- if ('undefined' !== typeof(oData.num) && false !== oData.num) {
- $('#bx-stream-processing').hide();
- $('.bx-stream-badge').show();
- }
- if ('undefined' !== typeof(oData.num) && false === oData.num) {
- $('.bx-stream-badge').hide();
- }
- }).always(function() {
- setTimeout(fFunc, 3000);
- });
- }
- else {
- setTimeout(fFunc, 3000);
- }
- }
- fFunc();
- </script>
|