Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random page reloads in iOS while streaming webcam to video #4624

Open
genekogan opened this issue Jun 16, 2020 · 3 comments
Open

Random page reloads in iOS while streaming webcam to video #4624

genekogan opened this issue Jun 16, 2020 · 3 comments

Comments

@genekogan
Copy link

This is the exact same problem reported in issue 2782 in 2017 and originally resolved with this commit. I am experiencing this issue again, possibly for a different reason.

My application streams video to aframe from a remote server using WebRTC. Everything works fine until I enter VR mode and rotate the phone to landscape. It continues to work as expected, streams reliably in VR mode, and looks fine, but after 10-20 seconds, the webpage randomly refreshes.

Note that the 360-video example which this is based on, does not have the issue, so the refresh is not triggered with a normal

  • A-Frame Version: 1.04
  • Platform / Device: iPhone 11, iOS
  • Reproducible Code Snippet or URL:
<html>
<head>
    <meta charset="UTF-8"/>
    <meta name="description" content="A-Frame webcam">
    <title>Aframe webcam</title>
    <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>

<a-scene>
    <a-assets>
        <video id="video" autoplay="true" crossOrigin="anonymous"></video>
    </a-assets>
    <a-videosphere src="#video" rotation="0 180 0"></a-videosphere>
</a-scene> 

<script>
    window.addEventListener('click', function () {
      var video = document.querySelector('#video');
      if (video.paused == true) {
        video.play();
        } else {
        video.pause();
      }
    }, false);
   
  </script>

</body>
</html>
@dmarcos
Copy link
Member

dmarcos commented Jun 16, 2020

Are there any error messages in console?

@dmarcos
Copy link
Member

dmarcos commented Jun 17, 2020

The refresh might be caused by a tab crash related to video playback over WebRTC as you mentioned.

@genekogan
Copy link
Author

No console errors that I can see. If it is a video playback error from the server, is there some way on the client side to catch an exception so as to avoid the crash?

I've been able to fix the issue simply by disabling the iOS wake lock function in aframe, but I'm afraid doing this introduces a new problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants