패키지, 저장소 및 앱 카테고리 검색

iqplayer 표지
패키지 상세v0.4.1

iqplayer

자막(자산, 파일, 네트워크, 문자열에서 로드할 수 있음)이 포함된 간단하고 멋진 비디오 플레이어입니다.

30일 다운로드
51
좋아요
38
Pub 점수
60

패키지 설치

flutter pub add iqplayer

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

IQPlayer는 자산, 로컬 파일, 네트워크 및 원시 문자열을 포함한 다양한 소스에서 자막을 지원하는 간단하고 강력한 플러터용 비디오 플레이어입니다. 직관적인 인터페이스와 부드러운 재생, 그리고 원활한 자막 통합을 제공하여 동기화된 자막이 필요한 앱에 이상적입니다. 이 패키지는 가볍고 구현이 쉬우며 기능을 희생하지 않고도 개발자 편의성에 중점을 둡니다.

사용 사례

  • 자막이 포함된 비디오 스트리밍
  • 로컬 자막과 함께 오프라인 비디오 재생
  • 교육용 앱에서 비디오 콘텐츠 표시
  • 네트워크 기반 비디오와 자막 지원 통합
  • 미디어가 풍부한 애플리케이션에 비디오 삽입

주요 기능

  • 여러 자막 소스를 지원합니다
  • Flutter와의 간편한 통합
  • 부드러운 비디오 재생
  • 사용자 정의 가능한 UI 요소
  • 자동 자막 동기화
  • 가볍고 빠름

적합한 대상

  • 비디오 중심 앱을 개발하는 개발자
  • 교육 또는 튜토리얼 플랫폼
  • 미디어 스트리밍 애플리케이션
  • 오프라인 비디오와 자막이 필요한 앱
  • 비디오 재생을 위해 최소한의 설정이 필요한 프로젝트

고려 사항

  • 제한된 플랫폼별 사용자 지정
  • 내장된 비디오 캐싱 없음
  • 자막 파일 형식을 수동으로 처리해야 합니다
  • 고해상도 4K 재생에 최적화되지 않음
  • 고급 기능을 위해 외부 종속성에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

IQPlayer

Simple video player with subtitle wrote for Flutter.

GitHub release (latest by date) GitHub GitHub followers

This package as a gift for my teacher and my leader Mr. Muqtada Al-Sadr.

Proudly based on BLoC.

Screenshot_1589120660

Features

  1. [x] Play video from Assets, Files, Network by VideoPlayerController from video_player.
  2. [x] Parse subtitles from Assets, Files, Network SubtitleProvider class.
  3. [x] Custom theme you can use with IQTheme class.
  4. [x] Support Subtitles:
    1. [x] VTT format
    2. [ ] SRT format
    3. [ ] User define format
  5. [x] IQScreen: a video player scaffold screen.
  6. [ ] IQPlayer: a widget enable you to watch video implement with your screen.
  7. [x] IQParser: a subtitle package that view subtitles, included the widget and parser.
  8. [x] IQTheme: to make your customizations on player ui and make it more integrated with your own app.

Installation

1. Depends on

Go to pubspec.yaml and add it to the dependencies list like:

dependencies:
  iqplayer: <latest_version>

Install packages from the command line with Flutter:

flutter pub get

2. Install

Android

Ensure the following permission is presented in your Android Manifest file, located in /android/app/src/main/AndroidManifest.xml:

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

The Flutter project template adds it, so it may already be there.

IOS

Warning: The video player is not functional on iOS simulators. An IOS device must be used during development/testing.

Add the following entry into your Info.plist file, located in /ios/Runner/Info.plist:

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

This entry allows your app to access video files by URL.

3. Import

Now in your Dart files, you can use:

import "package:iqplayer/iqplayer.dart";

Componets

  1. IQScreen:
IQScreen(
  videoPlayerController = VideoPlayerController.network(""),
  subtitleProvider: SubtitleProvider.fromNetwork(""),
  title: "Simple Video",
  description: "Simple Description",
);
  1. IQPlayer:

In development.

  1. IQParser:

Note: It is used automatically with IQScreen and you can use and display data with SubtitleProvider.

BlocProvider<SubtitleBloc>(
  create: (context) =>
    SubtitleBloc(
      SubtitleProvider.fromNetwork(""),
    )..add(FetchSubtitles()),
    child: MyParser(),
);
  1. IQTheme:

Note: You can customize your theme on IQScreen, IQPlayer or IQParser with this class.

You have +17 option to customize theme!

 IQScreen(
    ...
    iqTheme: IQTheme(
      ...
    ),
 );

Using

  1. Start using IQScreen with Navigator:
Navigator.push(
  context,
  MaterialPageRoute(
    builder: (BuildContext context) => IQScreen(
    title: "",
    description: "",
    videoPlayerController: VideoPlayerController.network(""),
    subtitleProvider: SubtitleProvider.fromNetwork(""),
   ),
  ),
);
  1. Using of IQParser:

You have to use BlocProvider with SubtitleProvider to configure subtitles.

// In Your widget
BlocProvider<SubtitleBloc>(
  create: (context) =>
    SubtitleBloc(
      SubtitleProvider.fromNetwork(""),
    )..add(FetchSubtitles()),
    child: MyParser(),
);

// new parser class, you can exclude `MyParser`
class MyParser extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return IQParser();
  }
}

Note: You can exclude "MyParser" and delete it!

Note: What is the reason for creating MyParser? see this

  1. You can use IQTheme to customize ui like:

You have +17 option to customize theme!

IQTheme(
    loadingProgress: SpinKitCircle(
      color: Colors.red,
    ),
    playButtonColor: Colors.transparent,
    videoPlayedColor: Colors.indigo,
    playButton: (bool isPlay) {
    if (isPlay)
        return Icon(
            Icons.pause_circle_filled,
            color: Colors.red,
            size: 50,
        );
    return Icon(
        Icons.play_circle_outline,
        color: Colors.red,
        size: 50,
        );
    },
);

Example

import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:iqplayer/iqplayer.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'IQPlayer Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'IQPlayer Demo'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: RaisedButton(
          child: Text('Open IQPlayer'),
          onPressed: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (BuildContext context) => IQScreen(
                  title: title,
                  description: 'Simple video as a demo video',
                  videoPlayerController: VideoPlayerController.network(
                    'https://d11b76aq44vj33.cloudfront.net/media/720/video/5def7824adbbc.mp4',
                  ),
                  subtitleProvider: SubtitleProvider.fromNetwork(
                      'https://duoidi6ujfbv.cloudfront.net/media/0/subtitles/5675420c9d9a3.vtt'),
                  iqTheme: IQTheme(
                    loadingProgress: SpinKitCircle(
                      color: Colors.red,
                    ),
                    playButtonColor: Colors.transparent,
                    videoPlayedColor: Colors.indigo,
                    playButton: (bool isPlay) {
                      if (isPlay)
                        return Icon(
                          Icons.pause_circle_filled,
                          color: Colors.red,
                          size: 50,
                        );
                      return Icon(
                        Icons.play_circle_outline,
                        color: Colors.red,
                        size: 50,
                      );
                    },
                  ),
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}

카테고리

의존성

의존성 목록 6 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.