Run Javascript ACTION

why this action its not working and so not starting the live stream automatically in the parent group > group > html (live) ?

parent group > group > html with live embed

Hi @i3jo.gere

Consider what happens in the workflow.

  1. Twitch embed html is told to be made visible
  2. Run javascript runs, cannot find twitchPlayer
  3. Twitch embed html dynamic data is filled in
  4. Twitch embed html is rendered
  5. Twitch embed html scripts start to run
  6. Browser loads embed script from url
  7. Twitch embed scripts continue to run
  8. twichPlayer is now defined

Depending on timing, Run javascript might happen at any of step 1, 2, 3, 4, or 5.

How to make the play() instruction happen at a more appropriate time?

Fairly straightforward, as you can alter the script in the HTML :

Option A - after creating the embed widget, invoke twitchPlayer.play()

Option B - if you want the operation under control of workflows, use Javascript to Bubble to start a new workflow, by bubble_fn_playerready(), in this workflow you can run twitchPlayer.play()

1 Like

Thanks a lot for the fast reply, much appreciated.
I’m not sure im doing well, since the value is not appearing in workflow…


html & js to bubble (in same group)

workflow

@i3jo.gere kudos for having a go at it!

Having your embed code in a repeating group will cause issues, the way its written it only works if its the only one on the page.

Have a read of this post and look at the linked example editor page, to get comfortable with javascript to bubble, see how many fixes you can do from there.

I need to get sleep, I’ll see in the morning how you got on. Maybe someone else will jump in too, haha.

i ve tried different things but cant manage to figure it out alone… im noob dev yet :S

I’m reluctant to offer further advice without knowing a lot more about your app and how it works.

Describe what is supposed to happen on the page, why you want to use workflows to autoplay, what else is supposed to happen on the workflows, why you have hidden HTML inside a repeating group.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.