diff --git a/src/modules/video_player/index.js b/src/modules/video_player/index.js index 57938fcbd8..b70966248c 100644 --- a/src/modules/video_player/index.js +++ b/src/modules/video_player/index.js @@ -57,11 +57,11 @@ class VideoPlayerModule { viewerCount() { try { - const controller = window.App && window.App.__container__.lookup('controller:channel'); - if (!controller || !controller.model || $('.player-viewer-count').length) return; + const player = window.App && window.App.__container__.lookup('service:persistent-player'); + if (!player || !player.playerComponent || $('.player-viewer-count').length) return; $('div.player-streamstatus').append(''); - controller.model.addObserver('stream.viewers', (model, key) => { + player.playerComponent.addObserver('channel.stream.viewers', (model, key) => { const viewers = model.get(key); if (!viewers) return; $('.player-viewer-count').text(`${Number(viewers).toLocaleString()} viewers`);