Skip to main content

'attached' and 'loaded' events not triggering(?)

Comments

3 comments

  • Bane

    Hi,

    Yes, you are right it is events. Will fix that. In the regards of the attached and loaded events, I think that there is a bit of confusion in the name of them so let me give you more details.

    Attached event will fire each time the embedding is attached to the page (to the DOM).

    This means that if you are using player you should see it only once and if you are using recording (without rerecording option) you would see it 2 times. Once for recorder code being attached to DOM and the second one for the player code being attached to the DOM (in recorder's place).

    Now the loaded event is similar, however a bit different. It is like Document loaded event just for embedding itself. It means all of its aspects have been loaded and the embedding itself is fully available. As such it will fire only once and it will ignore the fact that the module within it was removed and another attached. Again working just like Document loaded event would, as it fires only once page is completely loaded, even if most of it got changed to something else right after.

    So it seems to me that it is all firing as it should, and that the issue here would be the missing s. Also each of these events should have a reference to the embedding as its first attribute / parameter in case that helps.

    like application.embed_events.on('playing', function(embedding, ...) {});

    Regards,
    Bane

    1
  • DarthVeyda

    Hi,

    Sorry for the late reply & thanks for the explanation - that makes sense!

    0
  • Bane

    All good, happy if it helped :)

    Regards,
    Bane

    0

Please sign in to leave a comment.