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

BreaksPlayerPlugin - Not allow to select the break #765

Open
albacodina opened this issue Sep 1, 2021 · 0 comments
Open

BreaksPlayerPlugin - Not allow to select the break #765

albacodina opened this issue Sep 1, 2021 · 0 comments
Labels

Comments

@albacodina
Copy link

The BreakPlayer plugin skips the break but allows you to select minutes in it. Previously, this plugin didn't allow this selection.
I modify with this code:

skipTo(time) {
			var areBreaksClickable = paella.player.config.plugins.list[this.getName()].neverShow;
			var newTime = time + (areBreaksClickable ? .5 : 0);

			paella.player.videoContainer.trimming()
				.then((trimming) => {
					if (trimming.enabled) {
						if (time >= trimming.end) {
							newTime = 0;
							paella.player.videoContainer.pause();
						} else {
							newTime = time + (areBreaksClickable ? .5 : 0) - trimming.start;
						}
						paella.player.videoContainer.seekToTime(newTime);
					}
					else {
						return paella.player.videoContainer.duration(true);
					}
				}).then((duration) => {
					if (time >= duration) {
					  newTime = 0;
					  paella.player.videoContainer.pause();
					}
					paella.player.videoContainer.seekToTime(newTime);
				});
		}

But the problem is that when you select a minute in the break, the player plays a video one millisecond and I want to skip to the end of break without showing that millisecond.

Anyone have any ideas?

Thank you.

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

No branches or pull requests

1 participant