Copy text to clipboard

Copy static text

(data, liveData, event, element, player) => {
  const text = "TEXT TO COPY";
  navigator.clipboard.writeText(text); 
}

Copy text coming from live control

(data, liveData, event, element, player) => {
  const text = liveData.promoCode;
  navigator.clipboard.writeText(text); 
}

Copy text coming from per video data

(data, liveData, event, element, player) => {
  const text = data.promoCode;
  navigator.clipboard.writeText(text); 
}

Optional - add alert after the copy

navigator.clipboard
      .writeText(text)
      .then(() => {
        alert("successfully copied");
      })
      .catch(() => {
        alert("something went wrong");
      });

Or open a dynamic scene with thank you as another connector

Copy the code and then open a link immediately: