Code Monkey home page Code Monkey logo

fijkplayer_skin's Introduction

fijkplayer_skin

pub package

这是一款 fijkplayer 播放器的普通皮肤,主要解决 fijkplayer 自带的皮肤不好看,没有手势拖动快进,快退 fijkplayer_skin只是一款皮肤,并不是播放器,所以 fijkplayer 存在的问题,这里 fijkplayer_skin 一样存在

使用说明

在使用皮肤之前,你需要查看 fijkplayer 的文档说明,了解如何 fijkplayer 自定义UI

预览

Dart-Cms(web电影系统)

nodejs + mongodb 开发一套电影管理系统

Dart-Cms-Flutter(安卓)

安卓APP使用google flutter技术开发

安装

pubspec.yaml

dependencies:
  fijkplayer_skin: ${lastes_version}

使用示例

    # 引入 fijkplayer_skin
    import 'package:fijkplayer_skin/fijkplayer_skin.dart';
    # 引入 fijkplayer
    import 'package:fijkplayer/fijkplayer.dart';


    class VideoScreen extends StatefulWidget {
      final String url;

      VideoScreen({@required this.url});

      @override
      _VideoScreenState createState() => _VideoScreenState();
    }

    class _VideoScreenState extends State<VideoScreen> {
      final FijkPlayer player = FijkPlayer();

      _VideoScreenState();

      @override
      void initState() {
        super.initState();
        player.setDataSource(widget.url, autoPlay: true);
      }

      @override
      Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(title: Text("Fijkplayer Example")),
            body: Container(
              alignment: Alignment.center,
              # 这里 FijkView 开始为自定义 UI 部分
              child: FijkView(
                height: 240,
                color: Colors.black,
                fit: FijkFit.cover,
                player: player,
                panelBuilder: (
                  FijkPlayer player,
                  FijkData data,
                  BuildContext context,
                  Size viewSize,
                  Rect texturePos,
                ) {
                 /// 使用自定义的布局
                 return CustomFijkPanel(
                   player: player,
                   # 传递 context 用于左上角返回箭头关闭当前页面,不要传递错误 context,
                   # 如果要点击箭头关闭当前的页面,那必须传递当前页面的根 context
                   buildContext: context,
                   viewSize: viewSize,
                   texturePos: texturePos,
                   # 标题 当前页面顶部的标题部分
                   playerTitle: "标题",
                 );
              },
             );
          )
        );
      }

      @override
      void dispose() {
        super.dispose();
        player.release();
      }
    }

LICENSE

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.