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

Add 3-2-1 countdown #604

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

denismosolov
Copy link

No description provided.

Copy link
Member

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @denismosolov!

the deviceButton option should go into a separate PR.

In order to make this countdown more flexible I was thinking people would want to configure the:

  • time between steps (default: 1000msec)
  • amount of steps (default: 3)

The time between steps could be either a nr (1000 is default) or an array of integers.

Thoughts?

@denismosolov
Copy link
Author

denismosolov commented Aug 24, 2021

thanks @denismosolov!

the deviceButton option should go into a separate PR.

In order to make this countdown more flexible I was thinking people would want to configure the:

  • time between steps (default: 1000msec)
  • amount of steps (default: 3)

The time between steps could be either a nr (1000 is default) or an array of integers.

Thoughts?

Oh, I just forked it to tweak to my own use :) But I can add the parameters to make it customizable later. Also it does not have css yet. Sorry, I mistyped the target repo :)

@denismosolov denismosolov changed the title Add 3-2-1 countdown [WIP] Add 3-2-1 countdown Aug 25, 2021
@denismosolov
Copy link
Author

denismosolov commented Aug 25, 2021

@thijstriemstra thanks for the feedback!

I've updated some docs and got 69 files after running the npm build docs. Should I commit these files?

@thijstriemstra
Copy link
Member

Should I commit these files?

No, they'll be updated later.

@denismosolov
Copy link
Author

@thijstriemstra Finally, I'd like to lock the record button while the countdown is running. Is that acceptable?

Probably, I have to add a state _contdownActive to the Recorder and move the logic from the RecordToggle#handleClick to the Record#start

@thijstriemstra
Copy link
Member

Finally, I'd like to lock the record button while the countdown is running. Is that acceptable?

Makes sense.

@thijstriemstra
Copy link
Member

thijstriemstra commented Aug 26, 2021

Also, instead of adding two new options, what about adding one that takes an array of msec. This way we only need one option (length of array is amount of steps in the countdown, step length is array element value).

var steps = [1000, 1000, 1000];

or many steps:

var steps = [];
for (var d=0;d<10;d++) {
  steps.push(1000);
}

@denismosolov
Copy link
Author

Also, instead of adding two new options, what about adding one that takes an array of msec. This way we only need one option (length of array is amount of steps in the countdown, step length is array element value).

var steps = [1000, 1000, 1000];

or many steps:

var steps = [];
for (var d=0;d<10;d++) {
  steps.push(1000);
}

How about this:

steps: [
{value: 'Three', time: 1000}
{value: 'Two', time: 1000}
{value: 'One', time: 1000}
{value: 'Go!', time: 500}
]

A bit more complicated, but flexible.

@thijstriemstra
Copy link
Member

How about this:

Right, makes a lot of sense. I forgot you want to have a custom label for the countdown (or up).

Copy link
Member

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also needs a changelog entry.

docs/demo/countdown.html Outdated Show resolved Hide resolved
docs/demo/countdown.html Outdated Show resolved Hide resolved
docs/options.md Outdated Show resolved Hide resolved
examples/audio-video.html Outdated Show resolved Hide resolved
src/css/components/countdown-overlay.scss Outdated Show resolved Hide resolved
src/js/controls/record-toggle.js Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Sep 7, 2021

Coverage Status

coverage: 71.822% (+0.7%) from 71.152%
when pulling ab1c7f4 on denismosolov:countdown
into c1af296 on collab-project:master.

@denismosolov
Copy link
Author

Not ready yet

@denismosolov
Copy link
Author

Hi @thijstriemstra , any luck with the failing tests?

I've just added the final tweaks. Do you think this PR can be merged?

@thijstriemstra
Copy link
Member

@denismosolov sorry for the long wait, I would like to get this merged, so could you merge master into your branch?

@denismosolov
Copy link
Author

denismosolov commented Apr 5, 2024

@thijstriemstra merged. I use that countdown for two years in production and it works great. But I need to take a look at everything one more time. I think I'll do it during the April.

Would be great if we can merge it, so I can stop using my fork and switch to the upstream :)

@denismosolov
Copy link
Author

@thijstriemstra I wonder if npm run test runs all the tests from the test/ directory on you machine? When I switch to master branch it only runs 38 tests and that number is less that the total amount of tests.

@thijstriemstra
Copy link
Member

Yea all tests are run except 1 or so, similar to github actions: https://github.com/collab-project/videojs-record/actions/runs/8589870403/job/23541384429#step:12:2075

What OS/browser versions are you using @denismosolov?

@denismosolov
Copy link
Author

Thanks! I'll take a closer look this month.

I can see 106 tests here https://github.com/collab-project/videojs-record/actions/runs/8589870403/job/23541384429#step:12:2075
But, when I run npm run test on my macOS Somona it shows only 36.

@denismosolov
Copy link
Author

@thijstriemstra do you think this can be merged? I tested and it looks good to me

@thijstriemstra
Copy link
Member

But, when I run npm run test on my macOS Somona it shows only 36.

Do you have firefox and chrome installed?

@@ -44,6 +44,14 @@
video: true,
maxLength: 10,
displayMilliseconds: false,
countdown: [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd rather not add it to the default video demo, to keep the example as simple as possible.

@thijstriemstra
Copy link
Member

do you think this can be merged? I tested and it looks good to me

I'll have to test it first, thanks.

@denismosolov
Copy link
Author

denismosolov commented Apr 22, 2024

But, when I run npm run test on my macOS Somona it shows only 36.

Do you have firefox and chrome installed?

Chrome only. I'll install FF and try one more time

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

Successfully merging this pull request may close these issues.

None yet

3 participants