Gezinmeyi atla
Design Engineering Tip:
0:00 / 0:21

Design Engineering Tip:

Gabriel

@gabriell_lab13 B takipçi

X profili
567 beğeniİndirOrijinal gönderi

17.129 görüntüleme

Design Engineering Tip: Moving a playing embed to another spot with appendChild restarts it. The iframe is removed, then inserted again. moveBefore() moves it, and it keeps playing: if ("moveBefore" in slot) slot.moveBefore(player, null) else slot.insertBefore(player, null)

7 Yorum

Yorumlar X (Twitter) üzerindeki orijinal gönderiden alınmıştır

  • Todels ☁ profil fotoğrafı

    @todelsz

    you should make an entire article where you write all engineering tips or claude skill

    4 beğeni

  • Zafar profil fotoğrafı

    @zafartalks

    Wouldn’t picture-in-picture do the trick instead?

    1 beğeni

  • Griz profil fotoğrafı

    @itsGrizai

    does moveBefore work in safari yet or is it chrome only for now?

    1 beğeni

  • Code Hz profil fotoğrafı

    @code_hz

    or you can use view-transition

    1 beğeni

  • Sam profil fotoğrafı

    @dev_with_sam_

    did not know moveBefore was a thing yet, this is super useful actually. saves so much state headache

  • יוסי profil fotoğrafı

    @random11guy

    Claude knowns it already haha

  • Pablo Manjarres profil fotoğrafı

    @pablomanjarress

    finally, move nodes without killing playback