Frontmatter
| id | 5674 |
| title | component.Video: invalid addDomListeners() definition, ghost should be an overlay |
| state | Closed |
| labels | bug |
| assignees | Dinkh |
| createdAt | Aug 3, 2024, 8:29 PM |
| updatedAt | Aug 10, 2024, 6:41 PM |
| githubUrl | https://github.com/neomjs/neo/issues/5674 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Aug 10, 2024, 6:41 PM |
component.Video: invalid addDomListeners() definition, ghost should be an overlay
tobiu assigned to @Dinkh on Aug 3, 2024, 8:29 PM

tobiu
Aug 3, 2024, 9:14 PM
follow-up thoughts: it is of course ok to not mount the video node initially, if we start with the "ghost mode".
following idea:
afterSetPlaying(value, oldValue) {
// ...
media.removeDom = !value && oldValue === undefined;
// ...
}
without having looked into the styling, the top level node should probably get position: relative and the ghost position: absolute with a higher z-index than the video node.

Dinkh
Aug 10, 2024, 6:41 PM
removed the click event listener, which would lead to pause the video, as the video itself listens to click. The pause method is still in place to allow to pause the video programmatically.
Dinkh closed this issue on Aug 10, 2024, 6:41 PM
Hi Torsten,
me.addDomListeners( {click: me.play, delegate: '.neo-video-ghost'}, {click: me.pause, delegate: '.neo-video-media'} )is not correct. The method either accepts an object or an array of objects, but not multiple params.
me.addDomListeners([ {click: me.play, delegate: '.neo-video-ghost'}, {click: me.pause, delegate: '.neo-video-media'} ])If you use an array, the pause listener will get added too. However, this brings us to the next problem:
afterSetPlaying(value, oldValue) { let {vdom} = this, media = VDomUtil.getFlags(vdom, 'media')[0], ghost = VDomUtil.getFlags(vdom, 'ghost')[0]; ghost.removeDom = value; media.removeDom = !value; this.update() }Using
removeDomon the video node will kick it out of the DOM, and we will use the state of the video. Meaning: you watch it 10s, hit pause, hit play and you will start over at 0s.=> The ghost should be an overlay and the video node should not get removed.