EZ LIVE SHOW VIDEO - vMix TEST
==============================

This folder runs on the WINDOWS machine that has vMix on it.
You do NOT need to install or build anything fancy. This runs as-is.

Follow the steps in order. Do not skip step 8.


STEP 1 - Put this folder on the vMix computer
---------------------------------------------
If you downloaded a ZIP, right-click it and choose "Extract All" first.
Put the folder at:   C:\EZLive\app
(So you should end up with C:\EZLive\app\START.bat)


STEP 2 - Install Node (only if it is not already there)
--------------------------------------------------------
1. On the Windows machine, open Command Prompt.
2. Type:   node -v
3. If you see a version number like v20.11.0, you are done. Skip to Step 3.
4. If you see an error, go to https://nodejs.org and download the
   big green "LTS" button. Install it. Then close and reopen Command
   Prompt and try   node -v   again.


STEP 3 - ffmpeg (only if you downloaded the ZIP)
-------------------------------------------------
ffmpeg is the tool that turns the video into an MP4 that phones can play.

1. Look in this folder. Is there a file called ffmpeg.exe?

   YES -> you are done, skip to Step 4.

   NO  -> you have two choices:

      EASY: check what vMix is set to export. If vMix already exports
      .mp4 files, you do not need ffmpeg at all. Skip to Step 4.

      OTHERWISE: go to https://www.gyan.dev/ffmpeg/builds/ and download
      the "release essentials" zip. Open it, find ffmpeg.exe inside the
      bin folder, and copy it into C:\EZLive\app so it sits right next
      to START.bat.

If ffmpeg is missing AND vMix exports .avi files, the app still works -
but riders get .avi videos that most phones cannot play.


STEP 4 - Make the export folder
--------------------------------
1. Make this folder if it does not exist:   C:\EZLive\exports\export
2. In vMix, open Settings -> Recording / Replay export settings.
3. Make sure vMix exports replay clips into that exact folder.


STEP 5 - Start the app
-----------------------
1. Double-click START.bat in C:\EZLive\app
2. A black window opens. Leave it open. Closing it stops the app.
3. You should see lines like:

      EZ Live Show App (Node) running.
        Local:   http://localhost:5000

If it says something else, take a photo of the black window and send it to me.


STEP 6 - Open the app
----------------------
1. Open a web browser on that same machine.
2. Go to:   http://localhost:5000
3. You should see the operator page.


STEP 7 - Check vMix is connected
---------------------------------
1. Go to:   http://localhost:5000/settings
2. Find the vMix section and click "Test Connection".
3. You want a success / XML response. If it fails, vMix's Web Controller
   is probably turned off - turn it on in vMix settings and try again.


STEP 8 - THE IMPORTANT ONE: test the rename
--------------------------------------------
This is the step that has never been proven. Do not skip it.

1. In vMix, record at least one replay event so there is something to rename.
2. On the Settings page, click "Test Rename".
3. WATCH THE VMIX SCREEN WHILE YOU CLICK IT.
4. Look at the replay event list in vMix.

   - Did the last event's name actually change to "EZ Live Test Rider"?

   YES -> good, the rename works. Go to Step 9.

   NO  -> the app will say it worked even though it did not. vMix always
          says "OK" even for commands it does not understand. Tell me it
          failed and I will switch it to the other command name. It is a
          one-line change, no rebuild needed.


STEP 9 - Do one full real run
------------------------------
1. Go back to http://localhost:5000
2. Load a class (or use the riders already in there).
3. Pick one rider.
4. Click "Export & Send".
5. Watch what happens.

Tell me which of these you got:

   A) The rider went: exporting -> exported -> uploading -> uploaded -> emailed.
      That means everything works end to end.

   B) The rider got stuck on "Review file match" / a "Review file match"
      button appeared.
      This is expected if vMix does not put the rider's name into the
      exported filename. IMPORTANT: also tell me the exact filename that
      vMix created in C:\EZLive\exports\export - that tells me how to fix it.

   C) It failed with an error message. Send me the message.

   D) Nothing happened at all. Send me what the black window says.


WHAT I NEED BACK FROM YOU
--------------------------
Just three things:

   1. Did the vMix rename actually change the name on screen? (Step 8)
   2. Which letter did you get in Step 9 - A, B, C or D?
   3. The exact filename vMix created in C:\EZLive\exports\export


NOTES
------
- The .env file in this folder holds the Cloudflare and SendGrid keys the
  app uses to store and email videos. Treat this folder as private.
  Do not re-share it or post it anywhere public.
- The admin PIN for the Settings reset button is the same one already in use.
- To stop the app, close the black window.
