搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫januwA/flutter_video_box

flutter_video_box

flutter_video_box

flutter_video_box 專案封面
星標
22
分支
13
最近推送(UTC)
2022年9月23日
專案狀態
已封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

video_box

Play video in Flutter

note:

  • Only tested on android

android: <project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

ios: <project root>/ios/Runner/Info.plist:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

Usage

import 'package:flutter/material.dart';
import 'package:video_box/video.controller.dart';
import 'package:video_box/video_box.dart';
import 'package:video_player/video_player.dart';

class ListVideo extends StatefulWidget {
  @override
  _ListVideoState createState() => _ListVideoState();
}

class _ListVideoState extends State<ListVideo> {
  List<VideoController> vcs = [];

  @override
  void initState() {
    super.initState();
    for (var i = 0; i < 4; i++) {
      vcs.add(VideoController(source: VideoPlayerController.network(src1))
        ..initialize());
    }
  }

  @override
  void dispose() {
    for (var vc in vcs) {
      vc.dispose();
    }
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('list video'),
      ),
      body: ListView(
        children: <Widget>[
          for (var vc in vcs)
            Padding(
              padding: const EdgeInsets.only(top: 12.0),
              child: AspectRatio(
                aspectRatio: 16 / 9,
                child: VideoBox(controller: vc),
              ),
            ),
        ],
      ),
    );
  }
}

Catch the error during initialize

  vc = VideoController(
    source: VideoPlayerController.network('https://examole.com/a.mp4'),
  )
    ..addInitializeErrorListenner((e) {
      print('[video box init] error: ' + e.message);
    })
    ..initialize().then((e) {
      if (e != null) {
        print('[video box init] error: ' + e.message);
      } else {
        print('[video box init] success');
      }
    });

For details, see /example or source code.

show:

januwA GitHub avatar
GitHub 作者

januwA ↗

BYTE*

語言DartC++CMakeHTMLCSwiftShellKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 10 項

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗