How to use the render-media.render function in render-media

To help you get started, we’ve selected a few render-media examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storj / storj.js / lib / file.js View on Github external
File.prototype.renderTo = function renderTo(rootElem, cb) {
  cb = cb || function () {};
  var file = {
    name: `file${self._getExtension()}`,
    createReadStream: function() {
      return this.createReadStream();
    }
  };
  render.render(file, rootElem, cb);
};
github PearInc / PearPlayer.js / index.player.js View on Github external
torrent.files.forEach(function (file) {

                render.render(file, opts.selector, {autoplay: opts.autoplay});
            })
        })
github storj / storj.js / lib / File.js View on Github external
self._store.get(0, function(e, buffer) {
    if(e) { return cb(e); }
    var file = {
      name: `file${self._getExtension()}`,
      createReadStream: function(opts) {
        opts = opts || {};
        return from([
          buffer.slice(opts.start || 0, opts.end || (buffer.length - 1))
        ]);
      }
    };
    render.render(file, rootElem, cb);
  });
};
github PearInc / PearDownloader.js / index.player.js View on Github external
torrent.files.forEach(function (file) {

                render.render(file, opts.selector, {autoplay: opts.autoplay});
            })
        })
github webtorrent / webtorrent / lib / file.js View on Github external
renderTo (elem, opts, cb) {
    if (typeof window === 'undefined') throw new Error('browser-only method')
    render.render(this, elem, opts, cb)
  }
github xuset / aether-torrent / lib / file.js View on Github external
File.prototype.renderTo = function (elem, opts, cb) {
  cb = promisize(cb)
  render.render(this, elem, opts, cb)
  return cb.promise
}
github lbryio / lbry-desktop / ui / js / component / video / internal / player.jsx View on Github external
componentDidUpdate() {
    const { contentType, downloadCompleted } = this.props;
    const { startedPlaying } = this.state;

    if (this.playableType() && !startedPlaying && downloadCompleted) {
      const container = this.refs.media.children[0];

      if (VideoPlayer.MP3_CONTENT_TYPES.indexOf(contentType) > -1) {
        this.renderAudio(this.refs.media, true);
      } else {
        player.render(this.file(), container, {
          autoplay: true,
          controls: true,
        });
      }
    }
  }

render-media

Intelligently render media files in the browser

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis