OpenTok accessDenied issue in Chrome

给你一囗甜甜゛ 提交于 2019-12-03 16:19:21

This is a bug in the current JS library at OpenTok. I do have a workaround that should get you going and I'll come back with an update when the bug is fixed.

var waiting = false;
publisher.addEventListener('accessAllowed', function() {
  waiting = false;
  allowed();
});
publisher.addEventListener('accessDenied', function() {
  waiting = false;
  denied();
});
publisher.addEventListener('accessDialogOpened', function() {
  waiting = true;
});
publisher.addEventListener('accessDialogClosed', function() {
  setTimeout(function() {
    if (waiting) {
      waiting = false;
      denied();
    }
  }, 0);
});

This workaround is slightly limited because Chrome has some weirdness when it comes to denying access once and then visiting the page again. If the user hasn't changed his/her preferences regarding the media permissions, the video will continue to be denied and the 'accessDialogOpened' won't even fire. I'll inform the team and continue to look into this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!