last_pod_player 0.0.5 copy "last_pod_player: ^0.0.5" to clipboard
last_pod_player: ^0.0.5 copied to clipboard

Vimeo and youtube player for flutter, Pod player provides customizable video player controls that support android, ios and web.

example/lib/main.dart

import 'package:example/screens/from_asset.dart';
import 'package:example/screens/from_network.dart';
import 'package:example/screens/from_network_urls.dart';
import 'package:example/screens/from_vimeo_private_id.dart';
import 'package:example/screens/from_youtube.dart';
import 'package:flutter/material.dart';
import 'package:last_pod_player/last_pod_player.dart';

import 'screens/cutom_video_controllers.dart';
import 'screens/from_vimeo_id.dart';

void main() {
  PodVideoPlayer.enableLogs = true;
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      routes: {
        '/fromVimeoId': (context) => const PlayVideoFromVimeoId(),
        '/fromVimeoPrivateId': (context) => const PlayVideoFromVimeoPrivateId(),
        '/fromYoutube': (context) => const PlayVideoFromYoutube(),
        '/fromAsset': (context) => const PlayVideoFromAsset(),
        '/fromNetwork': (context) => const PlayVideoFromNetwork(),
        '/fromNetworkQualityUrls': (context) =>
            const PlayVideoFromNetworkQualityUrls(),
        '/customVideo': (context) => const CustomVideoControlls(),
      },
      home: const MainPage(),
    );
  }
}

class MainPage extends StatefulWidget {
  const MainPage({Key? key}) : super(key: key);

  @override
  State<MainPage> createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ListView(
          shrinkWrap: true,
          children: [
            // _button('Play video from File'),
            _button(
              'Play video from Network',
              onPressed: () => Navigator.of(context).pushNamed('/fromNetwork'),
            ),
            _button(
              'Play video from Youtube',
              onPressed: () => Navigator.of(context).pushNamed('/fromYoutube'),
            ),
            _button(
              'Play video from Network quality urls',
              onPressed: () =>
                  Navigator.of(context).pushNamed('/fromNetworkQualityUrls'),
            ),
            _button(
              'Play video from Asset (with custom labels)',
              onPressed: () => Navigator.of(context).pushNamed('/fromAsset'),
            ),
            _button(
              'Play video from Vimeo',
              onPressed: () => Navigator.of(context).pushNamed('/fromVimeoId'),
            ),
            _button(
              'Play private video from Vimeo',
              onPressed: () =>
                  Navigator.of(context).pushNamed('/fromVimeoPrivateId'),
            ),
            _button(
              'Custom Video player',
              onPressed: () => Navigator.of(context).pushNamed('/customVideo'),
            ),
          ],
        ),
      ),
    );
  }

  Widget _button(String text, {void Function()? onPressed}) {
    return Center(
      child: Padding(
        padding: const EdgeInsets.all(20),
        child: OutlinedButton(
          onPressed: onPressed ?? () {},
          child: Text(
            text,
            style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
          ),
        ),
      ),
    );
  }
}
5
likes
130
points
361
downloads
screenshot

Publisher

unverified uploader

Weekly Downloads

Vimeo and youtube player for flutter, Pod player provides customizable video player controls that support android, ios and web.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, get, http, universal_html, video_player, wakelock_plus, youtube_explode_dart

More

Packages that depend on last_pod_player