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

Question in client.js #6

Open
Genide opened this issue Apr 7, 2019 · 0 comments
Open

Question in client.js #6

Genide opened this issue Apr 7, 2019 · 0 comments

Comments

@Genide
Copy link

Genide commented Apr 7, 2019

In client.js, you have this section of code.

                video.autoplay = true;
                //video.get(0).play();
                video.play();

                await timeout(MySet.duration);

                addClass(video, 'hidden');
                await timeout(1000);

                video.pause();
                video.load();
                source.removeAttribute('src'); // empty source
                video.play();
                video.removeChild(source);
                video.muted = true; 
                callback();

I have a couple of questions.

  1. Why is video.load called after the first video.play? I believe this should be moved up.
  2. Why is video.play called a second time after the video has been hidden?

Proposed changes:

                video.load(); // Moved up to here
                video.play();

                await timeout(MySet.duration);

                addClass(video, 'hidden');
                await timeout(1000);

                video.pause();
                source.removeAttribute('src'); // empty source
                video.removeChild(source);
                video.muted = true;
                callback();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant