Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sarbagyastha/youtube_player
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.1
Choose a base ref
...
head repository: sarbagyastha/youtube_player
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 16 files changed
  • 3 contributors

Commits on Feb 24, 2019

  1. Licence changes

    Sarbagya committed Feb 24, 2019
    Copy the full SHA
    ae38d22 View commit details
  2. Licence changes

    Sarbagya committed Feb 24, 2019
    Copy the full SHA
    0eba9a3 View commit details

Commits on Apr 12, 2019

  1. Copy the full SHA
    8185a67 View commit details
  2. Copy the full SHA
    db7da9c View commit details
  3. Copy the full SHA
    dd48edf View commit details

Commits on Apr 17, 2019

  1. * [Fixed] Issues with onVideoEnded as [#28](#28).

    * [Feature Added] Support for 144p playback added, as requested in [#27](#27).
    * [Improved] Quality change uses Modal Bottom Sheet now.
    * Updated to latest dependencies.
    * Changed dart sdk constraint to `>=2.1.0 <3.0.0`.
    sarbagyastha committed Apr 17, 2019
    Copy the full SHA
    1bb4ce4 View commit details

Commits on Apr 21, 2019

  1. Copy the full SHA
    6ebe013 View commit details

Commits on Apr 23, 2019

  1. Fix for issue #31

    sarbagyastha committed Apr 23, 2019
    Copy the full SHA
    40ddd59 View commit details
  2. Dart Docs added

    sarbagyastha committed Apr 23, 2019
    Copy the full SHA
    9aa82c3 View commit details
  3. Added loop property

    sarbagyastha committed Apr 23, 2019
    Copy the full SHA
    c76f11e View commit details
  4. Added loop property

    sarbagyastha committed Apr 23, 2019
    Copy the full SHA
    1850147 View commit details

Commits on May 10, 2020

  1. Discontinued

    sarbagyastha authored May 10, 2020
    Copy the full SHA
    b237735 View commit details
  2. discontinued

    sarbagyastha committed May 10, 2020
    Copy the full SHA
    de065ef View commit details
27 changes: 27 additions & 0 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
## [3.1.1+2] - February 24, 2019.
## [3.5.0+1] - May 10, 2020
* Discontinued. Use [youtube_player_flutter](https://pub.dev/packages/youtube_player_flutter) instead.

## [3.4.1] - April 23, 2019
* [FIXED] Bugs with orientation changes.
* [FIXED] `onVideoEnded` being called more than once sometimes.
* [Feature Added] [`loop`](https://pub.dartlang.org/documentation/youtube_player/latest/youtube_player/YoutubePlayer/loop.html) property added.

## [3.4.0] - April 23, 2019
* [FIXED] Issue [#31](https://github.com/sarbagyastha/youtube_player/issues/31).
* [Feature Added] FullScreen on orientation change. This can controlled using new [`reactToOrientationChange`](https://pub.dartlang.org/documentation/youtube_player/latest/youtube_player/YoutubePlayer/reactToOrientationChange.html) property.
* Dart Docs Added.

## [3.3.0] - April 21, 2019
* Added option to hide share button using `hideShareButton` property.

## [3.2.2] - April 17, 2019.

* [Fixed] Issues with `onVideoEnded` as [#28](https://github.com/sarbagyastha/youtube_player/issues/28).
* [Feature Added] Support for 144p playback added, as requested in [#27](https://github.com/sarbagyastha/youtube_player/issues/27).
* [Improved] Quality change uses Modal Bottom Sheet now.
* Updated to latest dependencies.
* Changed dart sdk constraint to `>=2.1.0 <3.0.0`.


## [3.2.1] - April 12, 2019.

* `switchFullScreenOnLongPress` property added. If set to true, long press on a video will switch fullscreen.


## [3.2.0] - April 1, 2019.

* Issue [#21](https://github.com/sarbagyastha/youtube_player/issues/21) fixed.
* [IMPORTANT] Read *Note* section.

## [3.1.1+3] - February 24, 2019.

* Minor changes.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
The MIT License (MIT)

Copyright (c) 2019 Sarbagya Dhaubanjar

172 changes: 1 addition & 171 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,173 +1,3 @@
# Youtube Player Plugin

[![pub package](https://img.shields.io/badge/pub-v3.1.1+2-green.svg)](https://pub.dartlang.org/packages/youtube_player) [![Build Status](https://travis-ci.org/sarbagyastha/youtube_player.svg?branch=master)](https://travis-ci.org/sarbagyastha/youtube_player) [![licence](https://img.shields.io/badge/Licence-Apache%202-orange.svg)](https://github.com/sarbagyastha/youtube_player/blob/master/LICENSE)


A flutter plugin to play Youtube Videos "inline" without API Key in range of Qualities(240p, 360p, 480p, 720p and 1080p).

## Salient Features
- Inline playback
- Thumbnail Support
- Youtube-like controls
- Customizable Controls
- Supports HD and Full HD quality
- Playable through <video id> or <link>
- No need for API Key and no Limitations
- Supports Live Stream Videos

![DEMO](example_demo.gif)

## New Features in v3.x.x!
- Change video quality on-the-fly.
- Share video with other apps.
- Fast Forward and Rewind with double tap.
- Tap-and-hold to enter and exit fullscreen.
- Auto resize as per the video's aspect ratio.

## Usage

#### 1\. Depend

Add this to you package's `pubspec.yaml` file:

```yaml
dependencies:
youtube_player: ^3.1.1+2
```
#### 2\. Install
Run command:
```bash
$ flutter packages get
```

#### 3\. Import

Import in Dart code:

```dart
import 'package:youtube_player/youtube_player.dart';
```

#### 4\. Using Youtube Player
```dart
///
/// LOW = 240p
/// MEDIUM = 360p
/// HIGH = 480p
/// HD = 720p
/// FHD = 1080p
/// "source" can be either youtube video ID or link.
///
YoutubePlayer(
context: context,
source: "nPt8bK2gbaU",
quality: YoutubeQuality.HD,
// callbackController is (optional).
// use it to control player on your own.
callbackController: (controller) {
_videoController = controller;
},
),
```
#### 5\. Playing livestream videos
Must set isLive property to true in order to play livestream videos.

```dart
YoutubePlayer(
context: context,
source: "ddFvjfvPnqk",
quality: YoutubeQuality.HD,
**isLive: true,**
),
```

## Didn't like the controls ?
Don't worry, Got a solution for you. 😉
Set the playermode to NO_CONTROLS, then you can create your own custom controls using the controller obtained from callbackController property.

```dart
YoutubePlayer(
context: context,
source: "ddFvjfvPnqk",
playerMode: YoutubePlayerMode.NO_CONTROLS,
callbackController: (controller) {
_videoController = controller;
},
),
```


## Details
| Property | Description | Remarks |
| ------ | ------ | ------ |
| source | Source of youtube video. Video ID or URL | Required. |
| context | BuildContext of parent. | Required. |
| quality | Sets quality for youtube videos. | Required. |
| isLive | Denotes if the source is Live Video | Optional. Default = false.|
| aspectRatio | Sets aspect ratio of player's container | Optional. Default = 16/9 |
| width | Sets width of player's container | Optional. Default = Screen width. *Must be less than Screen Width.* |
| controlsActiveBackgroundOverlay | Sets video-wide overlay when controls are active | Optional. Default = true.|
| controlsColor | Sets color of controls like play, pause, etc. | Optional. |
| controlsTimeOut | Timeout for showing controls like play, pause, etc. | Optional. Default = 3 seconds |
| startAt | Sets the starting position of the video. | Optional. |
| showThumbnail | Shows thumbnail when video is initializing. | Optional. Default = true |
| keepScreenOn | Triggers screen to be on when not in fullscreen. | Optional. Default = true |
| showVideoProgressBar | Shows progressbar below the video. | Optional. Default = true |
| startFullScreen | Start video in a full screen. | Optional. Default = false |
| playerMode | Sets player mode. YoutubePlayerMode.NO_CONTROLS hides the controls from player. *Useful when custom controls are to be build.* | Optional. Default = YoutubePlayerMode.DEFAULT |
| onError | Callback which reports error. | Optional.|
| onVideoEnded | Callback which reports end of video. | Optional.|
| callbackController | Callback which provides current Video Controller. | Optional.|



## Example

[Example sources](https://github.com/sarbagyastha/youtube_player/tree/master/example)


### Limitation
* Only Available for Android (Currently)


### Todos
* Support for ios
* Adaptive playback as per the internet bandwidth

### Download
[Download apk](youtube_player_example.apk) and try the plugin.

***Credit***

This plugin is a fork of [video_player](https://github.com/flutter/plugins/tree/master/packages/video_player), developed by [@Flutter Team](https://github.com/flutter).


## License

```
Copyright (c) 2019 Sarbagya Dhaubanjar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

This plugin is discontinued. Please use [**youtube_player_flutter**](https://pub.dartlang.org/packages/youtube_player_flutter) which is an officially provided way of playing youtube videos, supporting both **Android** and **iOS** platforms.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

Loading