Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

New messages occasionally have paused video #52

Closed
tec27 opened this issue Oct 8, 2014 · 3 comments · Fixed by #57
Closed

New messages occasionally have paused video #52

tec27 opened this issue Oct 8, 2014 · 3 comments · Fixed by #57
Labels

Comments

@tec27
Copy link
Member

tec27 commented Oct 8, 2014

Definitely related to waypoints in some way, but if messages come in in quick succession (seemingly), the last couple messages (maybe more? maybe less?) don't get marked as being in view, or get marked as being in view and then marked as out of view, and so are paused until another message comes in.

I looked at the DOM in Chrome devtools when this occurred and definitely saw the last two videos, despite being visible, did not have the in-view class at the time.

I suspect this is something to do with the videos not being loaded when they're added to the DOM, although I have no real way to prove this easily. Further investigation needed!

@tec27 tec27 added the bug label Oct 8, 2014
@jasonrhodes
Copy link
Contributor

So the bug I'm seeing sounds like what @tec27 but not what @imakewebthings was finding and playing with last night, so possibly two different pause-related bugs? I saw this one at least 10-15 times last night, especially as more and more people were entering meatspace after Clay Shirky's tweets. I got it to happen once in my local machine, too (out of hundreds of times). Here's what I see:

  • Usually it's just the last (most recent) video that shows up paused initially
  • Grabbing a reference to that video, you find:
    • The in-view class is gone
    • video.paused === true
    • video.ended === false
    • video.play() // plays the video again, with looping
  • If you begin to scroll up the page at all, subsequent videos toggle their in-view state until all the videos are paused, and then they play again as you scroll down
  • The waypoint that triggers that reverse toggle seems to be at different places each time, ie sometimes it's all the videos in view that get paused as soon you start to scroll up and sometimes the top video on the screen is still playing until it moves down the screen a little further
  • Resizing the window in any way unpauses all the videos (resets the waypoints, I assume)
  • A new message unpauses all the videos

If I can get this to happen again locally I'll try to record a little of what I see...

@imakewebthings
Copy link
Member

@jasonrhodes Ok, this makes sense in the disparity between what I was seeing last night and the ways to resolve this (window resizing, adding chats.) I believe what I ran into was a Chrome-only bug that I've seen on v2 occasionally, which is that videos freeze randomly and enter that playing: true, ended: false, loop: true, currentTime: [the end] stuck state. We can't (or shouldn't?) do anything about that.

As @tec27 mentioned last night, chats are deleted after chats are added. Everything about your report, Jason, sounds like what would happen in that case. I'm more surprised that this isn't happening more often or all the time. While I can't reproduce this reliably with the current code base if you throw a setTimeout of any decent length around the chat removal block...

setTimeout(function () {
  if (children.length > MAX_LIMIT)
    ...
  }
}, 1000);

...once you get enough chats to where removal happens, you'll see this. If this is enough of a reproduce step, I'll send a PR to add the refresh after removal.

@jasonrhodes
Copy link
Contributor

Sounds pretty likely to me, @imakewebthings.

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

Successfully merging a pull request may close this issue.

3 participants