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

[Regions] Clicking inside region does not seek #3804

Open
rorr31 opened this issue Jul 30, 2024 · 3 comments
Open

[Regions] Clicking inside region does not seek #3804

rorr31 opened this issue Jul 30, 2024 · 3 comments

Comments

@rorr31
Copy link

rorr31 commented Jul 30, 2024

Since upgrading from 7.7.11 to 7.8.2, seeking no longer works when clicking inside a region. Clicking outside a region works fine. I'm seeing this behavior in both Chrome and Edge. On Firefox, clicking inside a region seeks the audio to that spot, as expected.

Prior to the upgrade, the audio would seek to the correct spot when clicking inside a region on all browsers.

@rorr31 rorr31 added the bug label Jul 30, 2024
@katspaugh katspaugh changed the title Clicking inside region does not seek [Regions] Clicking inside region does not seek Jul 30, 2024
@katspaugh
Copy link
Owner

katspaugh commented Aug 11, 2024

I've just tested Regions with this example and it seems to work as expected: https://wavesurfer.xyz/examples/?48950705f7944e2406b9e41c9e0152cc

Can you create a minimal reproducible code example?

@rorr31
Copy link
Author

rorr31 commented Aug 14, 2024

When I have a chance, I will attempt to create a reproducible code example. However, I was able to confirm that all versions 7.8 and above do not work as expected. Reverting back to 7.7.15 solved the problem.

Here is the code snippet that creates the regions:

				function addEditTimeRegion(turnItem, orderNo) {

					const
						id = turnItem.data('id'),
						start = convertMsToSeconds(turnItem.data('start-time-ms')),
						end = convertMsToSeconds(turnItem.data('end-time-ms')),
						audible = getAudible(turnItem.data('audible-id')) || null,
						colorProperty = turnItem.data('redacted-item-id') === undefined ? '--lw-review-source-translucent' : '--lw-review-error-translucent',
						content = getEditTimesContentHtml(turnItem.data('original-content'), audible);

					const options = {
						id: `${EDIT_REGION_ID_PREFIX}-${id}`,
						start: start,
						end: end,
						color: getComputedStyle(document.body).getPropertyValue(colorProperty),
						content: content
					};

					const region = wsRegions.addRegion(options);

					region.attributes = {
						turnItemId: id,
						orderNo: orderNo,
						origStart: start,
						origEnd: end,
						anchor: false,
						otherRegions: []
					};

					region.on('update', () => {
						moveTimes(region);
					});

					region.on('update-end', () => {
						updateTimes(region);
					});
				}

This snippet is the same regardless of what version of wavesurfer is used. When clicking within a region with 7.7.15, the player seeks to that point in the audio and plays from there. With 7.8.0 and above, nothing happens when I click in a region. The audio continues playing. I am also using the hover plugin. I'm not sure if that would make a difference or not.

@katspaugh
Copy link
Owner

It might be related to the fact that you're setting a custom HTML element in the content. I'll test this use case.

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

No branches or pull requests

2 participants