qyplayer 0.0.8 copy "qyplayer: ^0.0.8" to clipboard
qyplayer: ^0.0.8 copied to clipboard

outdated

a versatile video player. Supports m3u8, flv, mp4, and more. Simple, yet powerful, with a clean interface for seamless video playback in your Flutter projects.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:qyplayer/qyplayer.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'QYPlayer',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  GlobalKey<QYPlayeState> playerKey = GlobalKey<QYPlayeState>();

  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(
      const SystemUiOverlayStyle(
        systemNavigationBarColor: Colors.black,
        statusBarColor: Colors.black,
        statusBarIconBrightness: Brightness.light,
      ),
    );
    return Scaffold(
      body: QYPlayer(
        key: playerKey,
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        controls: false,
        // src: 'http://live.m2.tv/hls3/stream.m3u8',
        src:
            'https://video-js.51miz.com/preview/video/00/00/15/27/V-152772-2C867B97.mp4',
        loop: true,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          print(
              '>>>>>>>>> ${playerKey.currentState?.videoInstance?.isPlaying}');
        },
      ),
    );
  }
}
5
likes
0
points
43
downloads

Publisher

verified publisherdei3.com

Weekly Downloads

a versatile video player. Supports m3u8, flv, mp4, and more. Simple, yet powerful, with a clean interface for seamless video playback in your Flutter projects.

Repository

License

unknown (license)

Dependencies

ffmpeg_kit_flutter, flutter, provider, video_player

More

Packages that depend on qyplayer