vlc_player 0.0.4 copy "vlc_player: ^0.0.4" to clipboard
vlc_player: ^0.0.4 copied to clipboard

A Flutter plugin for video playback using VLC.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'src/full_player_example_page.dart';
import 'src/hls_example_page.dart';
import 'src/video_example_page.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({
    super.key,
    this.showPlayer = true,
    this.videoSource,
    this.hlsSource,
  });

  final bool showPlayer;
  final Uri? videoSource;
  final Uri? hlsSource;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: _ExampleListPage(
        showPlayer: showPlayer,
        videoSource: videoSource,
        hlsSource: hlsSource,
      ),
    );
  }
}

class _ExampleListPage extends StatelessWidget {
  const _ExampleListPage({
    required this.showPlayer,
    required this.videoSource,
    required this.hlsSource,
  });

  final bool showPlayer;
  final Uri? videoSource;
  final Uri? hlsSource;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('vlc_player example')),
      body: ListView(
        children: <Widget>[
          ListTile(
            key: const ValueKey<String>('video-example-tile'),
            title: const Text('Video file'),
            subtitle: const Text('Play an MP4 video file'),
            trailing: const Icon(Icons.chevron_right),
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute<void>(
                  builder: (_) => VideoExamplePage(
                    showPlayer: showPlayer,
                    source: videoSource,
                  ),
                ),
              );
            },
          ),
          ListTile(
            key: const ValueKey<String>('hls-example-tile'),
            title: const Text('HLS stream'),
            subtitle: const Text('Play an M3U8 HLS stream'),
            trailing: const Icon(Icons.chevron_right),
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute<void>(
                  builder: (_) =>
                      HlsExamplePage(showPlayer: showPlayer, source: hlsSource),
                ),
              );
            },
          ),
          ListTile(
            key: const ValueKey<String>('full-player-example-tile'),
            title: const Text('Full player'),
            subtitle: const Text('Fullscreen controls, seek, and orientation'),
            trailing: const Icon(Icons.chevron_right),
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute<void>(
                  builder: (_) => FullPlayerExamplePage(showPlayer: showPlayer),
                ),
              );
            },
          ),
        ],
      ),
    );
  }
}
0
likes
0
points
542
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for video playback using VLC.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on vlc_player

Packages that implement vlc_player