Browse Source

Fixed a simple bug that made all webtorrent videos autoplay.

master
Zed A. Shaw 2 months ago
parent
commit
a6924bbbe3
  1. 4
      client/wt.js

4
client/wt.js

@ -33,7 +33,7 @@ export class WTEvents {
constructor(media, video_opts) {
assert(media, "Media must exist.");
this.media = media;
this.video_opts = video_opts || {autoplay: true, controls: true, muted: false}
this.video_opts = video_opts || {autoplay: false, controls: true, muted: false}
this.appendId = `append-${media.target_id}`;
}
@ -45,7 +45,7 @@ export class WTEvents {
videoReady(file) {
this.media.kind = 'video';
file.renderTo(`#${this.appendId}`, {autoplay: true, controls: true, muted: false});
file.renderTo(`#${this.appendId}`, this.video_opts);
file.getBlobURL((err, url) => {
if(err) log.error(err, "getBlobURL error videoReady");
this.download_available(url);

Loading…
Cancel
Save