video_creator 0.0.1 copy "video_creator: ^0.0.1" to clipboard
video_creator: ^0.0.1 copied to clipboard

outdatedDart 1 only

A polymer element to create a simple video from a series of images

example/main.dart

import 'dart:html';

import 'package:polymer/polymer.dart';

import 'package:video_creator/src/frame.dart';

List frames = toObservable([]);

main() {
  initPolymer().run(() {
    Polymer.onReady.then((_) {
      querySelector('video-creator')
        ..frames = frames
        ..on['encode-complete'].listen((event) {
          VideoElement video = querySelector('video');
          video.src = Url.createObjectUrl(event.detail);
          video.onDurationChange.listen((e) {
            print('duration: ${video.duration}');
          });

          print('duration: ${video.duration}');
        })
        ;
    });

  });

  querySelector('#files').onChange.listen(upload);
}

void upload(Event e) {
  frames
    ..clear()
    ..addAll((e.target as FileUploadInputElement).files.map((file) {
      return new MyFrame(file, 2000, "This is my trip");
    }))
    ;
}


class MyFrame implements Frame {
  Blob image;
  String caption;
  int duration;

  MyFrame(this.image, this.duration, [this.caption = '']);
}
0
likes
40
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A polymer element to create a simple video from a series of images

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

polymer

More

Packages that depend on video_creator