Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

fix: cannot add sources #67

Closed
joemidi opened this issue Oct 28, 2016 · 0 comments
Closed

fix: cannot add sources #67

joemidi opened this issue Oct 28, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@joemidi
Copy link
Collaborator

joemidi commented Oct 28, 2016

You get the following error:

Uncaught TypeError: Cannot read property 'appendChild' of undefined

when video sources are being added to the SmartObject

We could move

        if (this.options.sources) {
          const sources = this.options.sources;
          const fragment = document.createDocumentFragment();
          for (let i = 0; i < sources.length; i++) {
            const sourceTag = document.createElement('source');
            sourceTag.src = sources[i].url;
            sourceTag.type = sources[i].type;
            fragment.appendChild(sourceTag);
          }
          this.element.appendChild(fragment);
        }

into the applySettings() method.

@joemidi joemidi added this to the 3.0 milestone Oct 28, 2016
@joemidi joemidi added the bug label Oct 28, 2016
@joemidi joemidi self-assigned this Oct 28, 2016
@joemidi joemidi closed this as completed Mar 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant