Пропустить навигацию
Design Engineering Tip:
0:00 / 0:21

Design Engineering Tip:

Gabriel

@gabriell_lab13 тыс. подписчиков

Открыть в X
567 отметок «Нравится»СкачатьОригинальный пост

17 129 просмотров

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 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Todels ☁

    @todelsz

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

    4 отметки «Нравится»

  • Фото профиля Zafar

    @zafartalks

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

    1 отметка «Нравится»

  • Фото профиля Griz

    @itsGrizai

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

    1 отметка «Нравится»

  • Фото профиля Code Hz

    @code_hz

    or you can use view-transition

    1 отметка «Нравится»

  • Фото профиля Sam

    @dev_with_sam_

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

  • Фото профиля יוסי

    @random11guy

    Claude knowns it already haha

  • Фото профиля Pablo Manjarres

    @pablomanjarress

    finally, move nodes without killing playback