iframe.ts 360 B

12345678910111213141516171819
  1. const iframe = new iFrame();
  2. iframe.on("UpdateData", async () => {
  3. const video = document.querySelector<HTMLVideoElement>(
  4. ".video-stream.html5-main-video"
  5. );
  6. if (video) {
  7. iframe.send({
  8. video: true,
  9. duration: video.duration,
  10. currentTime: video.currentTime,
  11. paused: video.paused,
  12. });
  13. } else {
  14. iframe.send({
  15. video: false,
  16. });
  17. }
  18. });