youtube_iframe_interop 0.1.0

Dart js
Flutter web

Youtube Iframe API interop

example/main.dart

import 'package:youtube_iframe_interop/youtube_iframe_interop.dart' as youtube;

Future<void> main() async {
  await youtube.loadYoutubeIframApi();

  youtube.onYouTubeIframeAPIReady = () {
    youtube.Player player;

    final onReady = (youtube.PlayerEvent e) {
      e.target.play();
      //player.play();

      //player.dispose();
    };

    player = youtube.Player(
      'player',
      options: youtube.PlayerOptions(
        height: 390,
        width: 640,
        videoId: 'M7lc1UVf-VE',
        events: youtube.PlayerEvents(
          onReady: onReady,
        ),
      ),
    );
  };
}
0
likes
70
pub points
49%
popularity

Publisher

lefty.io

Youtube Iframe API interop

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dart_browser_loader, js

More

Packages that depend on youtube_iframe_interop