-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Video overlay not tracking with scroll position of <video> #478
Comments
Hello @benallfree thank you for creating an issue properly. That not a bug but expected behavior, we do not refresh video automatically, here is what I recommend to do: // Scan every 500ms for refreshing video tag position and on various user events.
var scanVideoTagTimer,
scanVideoTagInterval = 500;
function scanVideoTag() {
clearTimeout(scanVideoTagTimer);
var shouldRefreshingVideos = $window.document.querySelectorAll('video').length > 0;
if (shouldRefreshingVideos) {
$window.cordova.plugins.iosrtc.refreshVideos();
}
scanVideoTagTimer = setTimeout(scanVideoTag, scanVideoTagInterval);
};
// Start scanVideoTag
scanVideoTagTimer = setTimeout(scanVideoTag, scanVideoTagInterval);
window.onorientationchange = scanVideoTag;
window.addEventListener('touchstart', scanVideoTag);
window.addEventListener('click', scanVideoTag);
window.addEventListener('touchmove', scanVideoTag);
window.addEventListener('touchend', scanVideoTag); You can also only refresh on user events, but in production this is what we do to hide video tag when there is a modal or a change of zIndex for example. |
I will update the documentation for next release, if you confirm this solutions works for you @benallfree |
Note: we already handle rotation here https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/js/iosrtc.js#L83 |
Closed due inactivity of reporter. |
Hi, is this a known issue? I have to call
cordova.plugins.iosrtc.refreshVideos()
in order to adjust the overlay after scrolling.Expected behavior
When
<video>
element changes position, the video overlay should change too.Observed behavior
Video overlay stays in a fixed floating position when underlying video element scrolls.
Steps to reproduce the problem
Please see https://github.com/benallfree/cordova-arjs-showcase/tree/master/demos/iosrtc-cam-demos
Notice that it snaps into place when I call
cordova.plugins.iosrtc.refreshVideos()
via the Safari debugger.Platform information
The text was updated successfully, but these errors were encountered: