yoyo_player 0.1.0 copy "yoyo_player: ^0.1.0" to clipboard
yoyo_player: ^0.1.0 copied to clipboard

yoyo_player is a video player that allows you to select HLS video streaming by selecting the quality

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:yoyo_player/yoyo_player.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool fullscreen = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      home: Scaffold(
        appBar: fullscreen == false
            ? AppBar(
                backgroundColor: Colors.blue,
                title: Image(
                  image: AssetImage('image/yoyo_logo.png'),
                  fit: BoxFit.fitHeight,
                  height: 50,
                ),
                centerTitle: true,
              )
            : null,
        body: Column(
          children: [
            YoYoPlayer(
              aspectRatio: 16 / 9,
              url:
                  // "https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4",
                  "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
              // "https://player.vimeo.com/external/440218055.m3u8?s=7ec886b4db9c3a52e0e7f5f917ba7287685ef67f&oauth2_token_id=1360367101",
              // "https://sfux-ext.sfux.info/hls/chapter/105/1588724110/1588724110.m3u8",
              videoStyle: VideoStyle(),
              videoLoadingStyle: VideoLoadingStyle(
                loading: Center(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Image(
                        image: AssetImage('image/yoyo_logo.png'),
                        fit: BoxFit.fitHeight,
                        height: 50,
                      ),
                      Text("Loading video"),
                    ],
                  ),
                ),
              ),
              onfullscreen: (t) {
                setState(() {
                  fullscreen = t;
                });
              },
            ),
          ],
        ),
      ),
    );
  }
}
126
likes
40
pub points
64%
popularity

Publisher

verified publisherkohtut.dev

yoyo_player is a video player that allows you to select HLS video streaming by selecting the quality

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter, http, orientation, path_provider, screen, video_player, video_player_web_hls, wakelock

More

Packages that depend on yoyo_player