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

패키지 상세v1.5.0

chewie_audio

Cupertino 및 Material 재생 컨트롤을 갖춘 Flutter용 오디오 플레이어

AndroidiOSWebmacOS
30일 다운로드
3.1만
좋아요
91
Pub 점수
140

패키지 설치

flutter pub add chewie_audio

패키지 개요

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

Chewie Audio는 Cupertino 및 Material 디자인에서 영감을 받은 직관적인 재생 컨트롤을 갖춘 사용자 정의 가능한 오디오 플레이어를 제공하는 Flutter 패키지입니다. Android, iOS, 웹, macOS 등 여러 플랫폼에서 오디오 파일 재생을 지원합니다. 단순성과 일관성을 고려하여 설계되었으며, 세련된 사용자 인터페이스를 갖춘 앱에 원활하게 통합될 수 있습니다. 내장된 진행률 추적, 재생/일시정지 기능, 볼륨 조절 기능을 제공하여 팟캐스트, 음악 플레이어 또는 신뢰할 수 있는 오디오 재생이 필요한 모든 앱에 적합합니다.

사용 사례

  • 팟캐스트 앱
  • 오디오북 리더
  • 음악 스트리밍 인터페이스
  • 교육 콘텐츠 플레이어
  • 인터랙티브 학습 앱

주요 기능

  • Cupertino 및 Material 디자인 컨트롤
  • 크로스 플랫폼 지원 (Android, iOS, Web, macOS)
  • 내장된 진행률 및 볼륨 표시기
  • Flutter와의 간단한 통합
  • 사용자 정의 재생 UI

적합한 대상

  • 오디오 중심의 Flutter 앱을 개발하는 개발자
  • 다양한 플랫폼 간 일관된 UI를 우선시하는 팀
  • 경량 오디오 재생이 필요한 앱
  • 교육용 또는 미디어가 풍부한 애플리케이션
  • Flutter의 네이티브 플랫폼 통합을 사용하는 프로젝트

고려 사항

  • 오디오 재생에 제한됨(비디오 없음)
  • 외부 오디오 소스 URL이 필요합니다
  • 복잡한 워크플로우를 위해 추가 상태 관리가 필요할 수 있습니다
  • 고성능 오디오 처리에 최적화되지 않음
  • 핵심 기능을 위해 하위 플러터 오디오 라이브러리에 의존합니다

원본 README

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

chewie_audio

Version CI Generic badge

The audio player for Flutter with a heart of gold.

The video_player plugin provides low-level access to video/audio playback. Chewie Audio uses the video_player under the hood and wraps it in a friendly Material or Cupertino UI!

Preview

MaterialControls

CupertinoControls

Installation

In your pubspec.yaml file within your Flutter Project:

dependencies:
  chewie_audio: <latest_version>
  video_player: <latest_version>

Use it

import 'package:chewie_audio/chewie_audio.dart';
final videoPlayerController = VideoPlayerController.network(
    'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4');

await videoPlayerController.initialize();

final chewieAudioController = ChewieAudioController(
  videoPlayerController: videoPlayerController,
  autoPlay: true,
  looping: true,
);

final playerWidget = ChewieAudio(
  controller: chewieAudioController,
);

Please make sure to dispose both controller widgets after use. For example by overriding the dispose method of the a StatefulWidget:

@override
void dispose() {
  videoPlayerController.dispose();
  chewieAudioController.dispose();
  super.dispose();
}

Options

Chewie got some options which controls the video you provide. These options appear on default on a showModalBottomSheet (like you already know from YT maybe). Chewie is passing on default Playback speed and Subtitles options as an OptionItem.

To add additional options just add these lines to your ChewieController:

additionalOptions: (context) {
  return <OptionItem>[
    OptionItem(
      onTap: () => debugPrint('My option works!'),
      iconData: Icons.chat,
      title: 'My localized title',
    ),
    OptionItem(
      onTap: () =>
          debugPrint('Another option working!'),
      iconData: Icons.chat,
      title: 'Another localized title',
    ),
  ];
},

If you don't like to show your options with the default showModalBottomSheet just override the View with the optionsBuilder method:

optionsBuilder: (context, defaultOptions) async {
  await showDialog<void>(
    context: context,
    builder: (ctx) {
      return AlertDialog(
        content: ListView.builder(
          itemCount: defaultOptions.length,
          itemBuilder: (_, i) => ActionChip(
            label: Text(defaultOptions[i].title),
            onPressed: () =>
                defaultOptions[i].onTap!(),
          ),
        ),
      );
    },
  );
},

Your additionalOptions are already included here (if you provided additionalOptions)!

Last but not least: What is an option without proper translation. To add your strings to them just add:

optionsTranslation: OptionsTranslation(
  playbackSpeedButtonText: 'Wiedergabegeschwindigkeit',
  subtitlesButtonText: 'Untertitel',
  cancelButtonText: 'Abbrechen',
),

Subtitles

Since version 1.1.0 chewie supports subtitles. Here you can see how to use them

You can provide an List<Subtitle> and customize your subtitles with the subtitleBuilder function.

Just add subtitles as following code is showing into your ChewieController:

ChewieController(
  videoPlayerController: _videoPlayerController,
  autoPlay: true,
  looping: true,
  subtitle: Subtitles([
    Subtitle(
      index: 0,
      start: Duration.zero,
      end: const Duration(seconds: 10),
      text: 'Hello from subtitles',
    ),
    Subtitle(
      index: 1,
      start: const Duration(seconds: 10),
      end: const Duration(seconds: 20),
      text: 'Whats up? :)',
    ),
  ]),
  subtitleBuilder: (context, subtitle) => Container(
    padding: const EdgeInsets.all(10.0),
    child: Text(
      subtitle,
      style: const TextStyle(color: Colors.white),
    ),
  ),
);

The index attribute is just for purpases if you want to structure your subtitles in your database and provide your indexes here. start, end and text are here the key attributes.

The Duration defines on which part of your video your subtitles should start and end. For example: Your video is 10 minutes long and you want to add a subtitle between: 00:00 and 00:10'th second you've to provide:

Subtitle(
  index: 0,
  start: Duration.zero,
  end: const Duration(seconds: 10),
  text: 'Hello from subtitles',
),

Example

Please run the app in the example/ folder to start playing!

Roadmap

  • [x] MaterialUI
  • [x] MaterialDesktopUI
  • [x] CupertinoUI
  • [x] Options with translations
  • [x] Subtitles
  • [x] CustomControls
  • [x] Auto-Rotate on FullScreen depending on Source Aspect-Ratio
  • [x] Live-Stream and UI
  • [x] AutoPlay
  • [x] Placeholder
  • [x] Looping
  • [x] Start video at
  • [x] Custom Progress-Bar colors
  • [x] Custom Overlay
  • [x] Allow Sleep (Wakelock)
  • [x] Playbackspeed Control
  • [x] Custom Route-Pagebuilder
  • [x] Custom Device-Orientation and SystemOverlay before and after fullscreen
  • [x] Custom ErrorBuilder
  • [ ] Support different resolutions of video
  • [ ] Re-design State-Manager with Provider
  • [ ] Screen-Mirroring / Casting (Google Chromecast)

iOS warning

The video_player plugin used by chewie_audio will only work in iOS simulators if you are on Flutter 1.26.0+. Please refer to this issue.

000000000000000KKKKKKKKKKKKXXXXXXXXXXXXXKKKKKKKKKKKKKKKKKKKKKKKKKKK00
000000000000000KKKKKKKKKKKKKXXXXXXXXXXKKKKKKKKKKKKKKKKKKKKKKKKKKKKK00
000000000000000KKKKKKKKKKKKKXXXXXXK0xdoddoclodxOKKKKKKKKKKKKKKKKKKK00
00000000000000KKKKKKKKKKKKKKKK0xoc:;;,;,,,,''';cldxO0KKKKKKKKKKKKK000
00000000000000KKKKKKKKKKKKKKx:'',,,'.,'...;,'''',;:clk0KKKKKKKKKKK000
00000000000000KKKKKKKKKKKKd;'',,,;;;'.,..,c;;,;;;;;:;;d0KKKKKKKKKK000
00000000000000KKKKKKKKKKx,',;:ccl;,c;';,,ol::coolc:;;,,x0KKKKKKKKK000
00000000000000KKKKKKKKOl;:;:clllll;;o;;;cooclddclllllc::kKKKKKKKKK000
00000000000000KKKKKK0o;:ccclccccooo:ooc:ddoddloddolc;;;:c0KKKKKKK0000
00000000000000KKKKKOccodolccclllooddddddxdxddxkkkkxxo;'';d0KKKKKK0000
00000000000000KKKKkcoddolllllclloodxxxxdddxdddxxxddool:'.;O0KKKKK0000
00000000000000000xloollcccc:cclclodkkxxxdddxxxkkxdlllolc,,x0KKKKK0000
0000000000000000xccllccccc:;,'',;:dxkxxddddxkkkxdollcc:cc;d0KKKKKK000
000000000000000kcc:::cllol:'......odxxdoccldxxxdollllc:;;:d0KKKKK0000
00000000000000klc;;;clcc::;'...';;;:cll..',cdddolccccccc;:x0KKKKK0000
0000000000000kdl;:cclllclllc::;,;.'.''o;,,'.;ccoooollllc:;x0KKKKK0000
000000000000kol;:;::coolcc:::,.....,..cd,....':lolclolllc;x0KKKK00000
00000000000Odl;:'cllol;''',;;;;::''.',:doc;,',::looc:lcol:x0K00000000
0000000000Oxl:c,:lolc,..',:clllollodoc;cllolccloolllcclollO0K00000000
0000000000xllc,:lool:'.,...o.;llxdo:loc;;ccodlolodldllolld00K0K000000
000000000Ooc::coooc,,.',;:lx,,...':;o;l;':o:oolccocdoldloO0000KK00000
00000000kol:clllc;;,.;::;:clllllolxc;.:c':ocldlccl;clldox000000000000
000000Odll:cccc;:;,';cllooodoollcloll;c:.:d:ooo;cl;oloddkO00000000000
0000OOddOdll;c,;;,,;;:cldodddoxdoodlcc:.,ox:o:lllocdlodx00O0000000000
000Oxdl:::ll,:,:;,';c,:oloddolkxddxolc.'coccocolcccoooc;oxO00KOOOO000
dc;,'...';c,,:c:::'c:';cldoo;:odolxoc:.,o:oldlxol;lddl,.,lkO0KdlcckKO
'.......,:''';cll:cc,,;:l:c,,;:oc;cdc,.;::dldoxd:ldol;,'..,:lo,,,,kOk
.......';'.',:clcll,,;:l:;'..''c:,;cl'.';dxoooxlddl;',''..,,;'...,ool
.......,,.'';;:cld;.;,do:..;:,':c',:c''';xxdldocol'..';,.......',;;,;
.......'..'',,coxc'';:do'.clc:lco',o;',;cOxdol:cc:.....'..oxd;','.'..
'.......''..,:cxl;';;cx:''cll:clc'cl',:l:ko:c..;c:..';...,KNNl;:;ll:'
.......''...;,ooc,,,:od'.':cccdd,,l''cl:co;;,..;;'..','..;d0O,;;:XXXK
............'cll;',,lo'.'.::codl,c..:c;doc.,:.',....'...'......'l0XKk
'............c;;,':lc.'',.;ccol;:,.:c.:o,;'.;'......,...',,.'...'.,;;
.............',;;,cc..;,'';:lc':;..c'.c:;.,......,'..'...'',:,,;;,...
..............',,;:'.';,',:c;.;;..';..,;,.........''..'...'kko.,,....
...............;,:'..;''';:,..;''.''..''............'...'.lK0c';;c;'.
...............,,'...,.',;''...''....,......'............'dOx',;:dd,'
..............',.....'.,;..'..',..........'..............';:;',,ldo.'
.............'''.'.....,'..',','..'...''..'............'.......,dx'.'
.......................,...';,'..'.....,.'.............''.'......'..'
...........'......'...',..'';,'..'.....................',';,..'....'.

카테고리

의존성

의존성 목록 2 개

소스 저장소

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

아직 데이터가 없습니다.