Fix #1722: Wait for dashjs before creating element(s) if loaded asynchronously
Created by: JontyUsborne
Fixes #1722 (closed) caused by #1694, without re-breaking initial issue (#1680 (closed)).
When MediaPlayerFactory tries to create elements:
- document is complete and dashjs loaded -> continue as normal
- document is not complete (#1722 (closed)) -> add a load event listener
- document is complete but dashjs undefined (#1680 (closed)) -> set an interval to wait for dashjs
There's probably a less icky way of achieving this without the need for the interval though?