Skip navigation
Design Engineering Tip:
0:00 / 0:21

Design Engineering Tip:

Gabriel

@gabriell_lab13K followers

Visit on X
567 likesDownloadOriginal post

17,129 views

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 Comments

Comments from the original post on X (Twitter)

  • Todels ☁'s profile picture

    @todelsz

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

    4 likes

  • Zafar's profile picture

    @zafartalks

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

    1 like

  • Griz's profile picture

    @itsGrizai

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

    1 like

  • Code Hz's profile picture

    @code_hz

    or you can use view-transition

    1 like

  • Sam's profile picture

    @dev_with_sam_

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

  • יוסי's profile picture

    @random11guy

    Claude knowns it already haha

  • Pablo Manjarres's profile picture

    @pablomanjarress

    finally, move nodes without killing playback