bool state1 = false;
bool state2 = false;
unsigned long tempsON1 = 0;
unsigned long tempsON2 = 0;
const int motionPin = 2;
const int soundPin  = 4;
int motionState = 0;
int soundState  = 0;
const unsigned long attente1 = 10ul * 60ul * 1000ul; // minutes
const unsigned long attente2 = 30ul * 1000ul; // secondes

void setup() {
  Serial.begin(9600);
  pinMode(motionPin, INPUT);
  pinMode(soundPin, INPUT);
}

void loop() {
  if (!state1) {
    motionState = digitalRead(motionPin);
    if (motionState == LOW) {
      tempsON1 = millis();
      state1 = true;
      // lancer la vidéo n°1
      Serial.println("1");
    }
  }
  if (millis() - tempsON1 > attente1) state1 = false;

  if (!state2) {
    soundState = digitalRead(soundPin);
    if (soundState == LOW) {
      tempsON2 = millis();
      state2 = true;
      // lancer la vidéo n°2
      Serial.println("2");
    }
  }
  if (millis() - tempsON2 > attente2) state2 = false;
}
