I'm trying to make a widget that would provide youtube videos inlining via 
the youtube iframe api, basically rendering <$youtube video={{!!myvideo}} 
/> into the youtube player.


To facilitate this, I added a tiddler tagged $:/tags/RawMarkup with the 
following contents:

    <script src="https://www.youtube.com/iframe_api";></script>

Which adds the required API to the header.

Now, because TW core doesn't wait for the document ready, the widgets begin 
rendering before the api in question becomes available at window.YT, thus 
the page reload always fails to show any youtube videos. Toggling the 
tiddler fixes the issue, but it's somewhat a disappointing method of 
management.

What would be the best way to defer rendering until the api is loaded 
properly? Alternatively, what's the safest way to refresh a widget if I go 
the route of setTimeout-polling for the api being loaded?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/d9fd7989-4e55-4c31-b70b-a72acf214a33o%40googlegroups.com.

Reply via email to