Skip to content

Commit

Permalink
Complete 0.4v
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhmdHsn313 committed Jul 18, 2020
2 parents a9948d7 + c07c0b1 commit 75424d9
Show file tree
Hide file tree
Showing 27 changed files with 924 additions and 312 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
}
]
}
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
## [0.1.0] - Spring.
## [0.4.0] - Permanence.

* Added `IQScreen` class that enable user to use a plyer as a screen.
* Support `Html` & `Css` styles.
* Fixed player bugs.
* Enhance code logic.
* Provide a dartdoc comments for all package.

## [0.3.0-beta.1] - Frost.

* Added `IQTheme` to customization your ui.
* Fixed bugs with forward & backward.
* Enhance code logic.

## [0.2.1] - Storm.

* Edit Readme file.

## [0.2.0] - Storm.

* Added `SubtitleProvider` class that enable user to use a subtitle from files, assets, network, string.
* Added `IQParser` class to display subtitle data.
* Added `SubtitleBloc` class to use with `IQParser`.

## [0.1.0] - Spring.

* Added `IQScreen` class that enable user to use a plyer as a screen.
78 changes: 72 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ Simple video player with subtitle wrote for Flutter.
> Proudly based on [BLoC](https://pub.dev/packages/flutter_bloc).
![Screenshot_1588590912](https://user-images.githubusercontent.com/33749659/80967088-75847700-8e1e-11ea-83fc-db6d4c056f26.png)

![Screenshot_1589120660](https://user-images.githubusercontent.com/33749659/81501966-bdeed980-92e3-11ea-88b5-365cfe93bd1a.png)

## Features
1. [x] Play videos from assets, files, network by `VideoPlayerController` from video_player.
2. [x] Parse subtitles from assets, files, network `SubtitleProvider` class.
3. [ ] Custom theme you can use with `IQTheme` class.
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
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
Expand Down Expand Up @@ -98,6 +101,21 @@ BlocProvider<SubtitleBloc>(
);
```


4. **IQTheme:**
> Note: You can customize your theme on `IQScreen`, `IQPlayer` or `IQParser` with this class.
> You have +17 option to customize theme!
```dart
IQScreen(
...
iqTheme: IQTheme(
...
),
);
```

# Using

1. Start using `IQScreen` with Navigator:
Expand Down Expand Up @@ -142,9 +160,38 @@ class MyParser extends StatelessWidget {
> Note: What is the reason for creating `MyParser`? [see this](https://bloclibrary.dev/#/faqs?id=blocproviderof-fails-to-find-bloc)

3. You can use `IQTheme` to customize ui like:

> You have +17 option to customize theme!
```dart
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
```dart
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:iqplayer/iqplayer.dart';
void main() {
Expand Down Expand Up @@ -190,7 +237,26 @@ class MyHomePage extends StatelessWidget {
'https://d11b76aq44vj33.cloudfront.net/media/720/video/5def7824adbbc.mp4',
),
subtitleProvider: SubtitleProvider.fromNetwork(
'https://duoidi6ujfbv.cloudfront.net/media/0/subtitles/5675420c9d9a3.vtt'
'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,
);
},
),
),
),
Expand Down
83 changes: 64 additions & 19 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:iqplayer/iqplayer.dart';

void main() {
Expand Down Expand Up @@ -31,27 +32,71 @@ class MyHomePage extends StatelessWidget {
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'
child: Column(
children: [
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.fromString(
"""WEBVTT
00:00:00.650 --> 00:00:03.000
<p style="color:blue">Hello World</p>
00:00:03.024 --> 00:00:07.524
<i>Mindmarker je krátká zpráva formou
videa, souborů PDF...</i>
00:00:07.548 --> 00:00:12.448
<span style='color:brown'>colorful</span>
00:00:12.472 --> 00:00:16.072
Mindmarker budeš obdržovat
ve specifický chvílích...
00:00:16.100 --> 00:00:20.100
abychom lépe utužili tvé znalosti.""",
),
// 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: (BuildContext context, bool isPlay,
AnimationController animationController) {
if (isPlay)
return Icon(
Icons.pause_circle_filled,
color: Colors.red,
size: 50,
);
return Icon(
Icons.play_circle_outline,
color: Colors.red,
size: 50,
);
},
),
),
),
),
),
);
},
);
},
),
],
),
),
);
}
}
}
Loading

0 comments on commit 75424d9

Please sign in to comment.