Skip to content

Commit

Permalink
Update README & CHANGELOG, update package version to 0.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhmdHsn313 committed May 4, 2020
1 parent 05c21df commit 9a36a0b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.1.0] - Spring.

* Added `IQScreen` class that enable user to use a plyer as a screen.

## [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`.
56 changes: 48 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ Simple video player with subtitle wrote for flutter.
## Features
1. [x] Play video from Assets, Files, Network by `VideoPlayerController` from video_player.
2. [ ] Parse subtitles from Assets, Files, Network `SubtitleProvider` class.
2. [x] Parse subtitles from Assets, Files, Network `SubtitleProvider` class.
3. [ ] Custom theme you can use with `IQTheme` class.
4. [ ] Support Subtitles:
1. [ ] VTT format
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. [ ] **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

# Installation
## 1. Depend on
Go to `pubspec.yaml` and set the dependencies like:

```yaml
dependencies:
iqplayer: ^0.0.1
iqplayer: <latest_version>
```
Install packages from the command line with Flutter:
Expand All @@ -50,7 +50,7 @@ The Flutter project template adds it, so it may already be there.
Warning: The video player is not functional on iOS simulators. An iOS device must be used during development/testing.

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:
```plist
```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand All @@ -72,6 +72,7 @@ import "package:iqplayer/iqplayer.dart";
```dart
IQScreen(
videoPlayerController = VideoPlayerController.network(""),
subtitleProvider: SubtitleProvider.fromNetwork(""),
title: "Simple Video",
description: "Simple Description",
);
Expand All @@ -81,8 +82,18 @@ IQScreen(
> In development.
3. **IQParser:**
> In development.

> Note: It is used automatically with `IQScreen` and you can use and display data with `SubtitleProvider`.
```dart
BlocProvider<SubtitleBloc>(
create: (context) =>
SubtitleBloc(
SubtitleProvider.fromNetwork(""),
)..add(FetchSubtitles()),
child: MyParser(),
);
```
# Using

1. Start use `IQScreen` with Navigator:
Expand All @@ -95,11 +106,38 @@ Navigator.push(
title: "",
description: "",
videoPlayerController: VideoPlayerController.network(""),
subtitleProvider: SubtitleProvider.fromNetwork(""),
),
),
);
```

2. Using of `IQParser`:

> You have to use `BlocProvider` with `SubtitleProvider` to configure subtitles.
```dart
// 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](https://bloclibrary.dev/#/faqs?id=blocproviderof-fails-to-find-bloc)
# Example
```dart
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -147,6 +185,9 @@ class MyHomePage extends StatelessWidget {
videoPlayerController: VideoPlayerController.network(
'https://d11b76aq44vj33.cloudfront.net/media/720/video/5def7824adbbc.mp4',
),
subtitleProvider: SubtitleProvider.fromNetwork(
'https://duoidi6ujfbv.cloudfront.net/media/0/subtitles/5675420c9d9a3.vtt'
),
),
),
);
Expand All @@ -156,5 +197,4 @@ class MyHomePage extends StatelessWidget {
);
}
}
```
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: iqplayer
description: Simple awesome video player with subtitle (you can load from assets, file, network, string).
version: 0.1.0
version: 0.2.0
homepage: https://github.com/MuhmdHsn313/IQPlayer

environment:
Expand Down

0 comments on commit 9a36a0b

Please sign in to comment.