Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rohitprajapatii/flick-video-playe…
Browse files Browse the repository at this point in the history
…r into fix/register-context
  • Loading branch information
rohitprajapati0606 committed Jul 18, 2024
2 parents 7c31846 + 372ebdc commit 561b0e3
Show file tree
Hide file tree
Showing 32 changed files with 234 additions and 194 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,19 @@ Fix - Static analysis
Updated Flutter version to 3.16.

Upgraded dependencies

## 0.7.0

Fix - pub.dev warnings

Fix - Deprecated widgets

Fix - Web full screen issue.

## 0.8.0

Updated wakelock to wakelock_plus: ^1.1.4

Updated video_player to latest version video_player: ^2.8.6

Fix - Formatting
27 changes: 17 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
Copyright 2020 GeekyAnts
The MIT License (MIT)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Copyright (c) 2021 GeekyAnts India Pvt Ltd

http://www.apache.org/licenses/LICENSE-2.0
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:

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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.
143 changes: 74 additions & 69 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -343,7 +343,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -421,7 +421,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -470,7 +470,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/lib/animation_player/animation_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _AnimationPlayerState extends State<AnimationPlayer> {
// String url = items[0]['trailer_url'];
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.network(items[0]['trailer_url']),
VideoPlayerController.networkUrl(Uri.parse(items[0]['trailer_url'])),
onVideoEnd: () => dataManager.playNextVideo(
Duration(seconds: 5),
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/animation_player/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AnimationPlayerDataManager {
}

flickManager.handleChangeVideo(
VideoPlayerController.network(nextVideoUrl),
VideoPlayerController.networkUrl(Uri.parse(nextVideoUrl)),
videoChangeDuration: duration, timerCancelCallback: (bool playNext) {
videoChangeTimer.cancel();
if (playNext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class _CustomOrientationPlayerState extends State<CustomOrientationPlayer> {
void initState() {
super.initState();
flickManager = FlickManager(
videoPlayerController: VideoPlayerController.network(
urls[0],
videoPlayerController: VideoPlayerController.networkUrl(
Uri.parse(urls[0]),
),
onVideoEnd: () {
dataManager.skipToNextVideo(Duration(seconds: 5));
Expand All @@ -44,7 +44,8 @@ class _CustomOrientationPlayerState extends State<CustomOrientationPlayer> {
}

skipToVideo(String url) {
flickManager.handleChangeVideo(VideoPlayerController.network(url));
flickManager
.handleChangeVideo(VideoPlayerController.networkUrl(Uri.parse(url)));
}

@override
Expand Down
4 changes: 2 additions & 2 deletions example/lib/custom_orientation_player/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DataManager {
skipToNextVideo([Duration? duration]) {
if (hasNextVideo()) {
flickManager.handleChangeVideo(
VideoPlayerController.network(urls[currentPlaying + 1]),
VideoPlayerController.networkUrl(Uri.parse(urls[currentPlaying + 1])),
videoChangeDuration: duration);

currentPlaying++;
Expand All @@ -39,7 +39,7 @@ class DataManager {
if (hasPreviousVideo()) {
currentPlaying--;
flickManager.handleChangeVideo(
VideoPlayerController.network(urls[currentPlaying]));
VideoPlayerController.networkUrl(Uri.parse(urls[currentPlaying])));
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/lib/default_player/default_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class _DefaultPlayerState extends State<DefaultPlayer> {
void initState() {
super.initState();
flickManager = FlickManager(
videoPlayerController: VideoPlayerController.network(
mockData["items"][0]["trailer_url"],
videoPlayerController: VideoPlayerController.networkUrl(
Uri.parse(mockData["items"][0]["trailer_url"]),
closedCaptionFile: _loadCaptions(),
),
);
Expand Down
5 changes: 3 additions & 2 deletions example/lib/feed_player/multi_manager/flick_multi_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class _FlickMultiPlayerState extends State<FlickMultiPlayer> {
@override
void initState() {
flickManager = FlickManager(
videoPlayerController: VideoPlayerController.network(widget.url)
..setLooping(true),
videoPlayerController:
VideoPlayerController.networkUrl(Uri.parse(widget.url))
..setLooping(true),
autoPlay: false,
);
widget.flickMultiManager.init(flickManager);
Expand Down
4 changes: 2 additions & 2 deletions example/lib/landscape_player/landscape_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class _LandscapePlayerState extends State<LandscapePlayer> {
void initState() {
super.initState();
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.network(mockData["items"][2]["trailer_url"]));
videoPlayerController: VideoPlayerController.networkUrl(
Uri.parse(mockData["items"][2]["trailer_url"])));
}

@override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:example/landscape_player/play_toggle.dart';
import 'package:flick_video_player/flick_video_player.dart';
import 'package:flutter/material.dart';
Expand Down
32 changes: 17 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,23 @@ class _ExamplesState extends State<Examples> {
}

Widget _buildWebView() {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(child: WebVideoPlayer()),
Container(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Text('Flick video player',
style: TextStyle(
color: Color.fromRGBO(100, 109, 236, 1),
fontWeight: FontWeight.bold,
)),
),
)
],
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
WebVideoPlayer(),
Container(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Text('Flick video player',
style: TextStyle(
color: Color.fromRGBO(100, 109, 236, 1),
fontWeight: FontWeight.bold,
)),
),
)
],
),
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import 'package:flick_video_player/flick_video_player.dart';

import 'package:flutter/material.dart';
import 'package:visibility_detector/visibility_detector.dart';
import 'package:video_player/video_player.dart';
import 'package:visibility_detector/visibility_detector.dart';

import '../../../feed_player/multi_manager/flick_multi_manager.dart';
import '../../../feed_player/portrait_controls.dart';

class FlickMultiPlayer extends StatefulWidget {
const FlickMultiPlayer(
{Key? key,
required this.url,
this.image,
required this.flickMultiManager})
{Key? key, required this.url, this.image, required this.flickMultiManager})
: super(key: key);

final String url;
Expand All @@ -29,9 +25,8 @@ class _FlickMultiPlayerState extends State<FlickMultiPlayer> {
@override
void initState() {
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.contentUri(Uri.file(widget.url))
..setLooping(true),
videoPlayerController: VideoPlayerController.contentUri(Uri.file(widget.url))
..setLooping(true),
autoPlay: false,
);
widget.flickMultiManager.init(flickManager);
Expand Down
4 changes: 2 additions & 2 deletions example/lib/web_video_player/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DataManager {
skipToNextVideo([Duration? duration]) {
if (hasNextVideo()) {
flickManager.handleChangeVideo(
VideoPlayerController.network(urls[currentPlaying + 1]),
VideoPlayerController.networkUrl(Uri.parse(urls[currentPlaying + 1])),
videoChangeDuration: duration);

++currentPlaying;
Expand All @@ -39,7 +39,7 @@ class DataManager {
if (hasPreviousVideo()) {
currentPlaying--;
flickManager.handleChangeVideo(
VideoPlayerController.network(urls[currentPlaying]));
VideoPlayerController.networkUrl(Uri.parse(urls[currentPlaying])));
}
}

Expand Down
3 changes: 0 additions & 3 deletions example/lib/web_video_player/web_video_control.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flick_video_player/flick_video_player.dart';
import 'package:provider/provider.dart';

import 'data_manager.dart';

Expand Down Expand Up @@ -32,8 +31,6 @@ class WebVideoControl extends StatelessWidget {

@override
Widget build(BuildContext context) {
FlickVideoManager flickVideoManager =
Provider.of<FlickVideoManager>(context);
return FlickShowControlsActionWeb(
child: Stack(
children: <Widget>[
Expand Down
4 changes: 2 additions & 2 deletions example/lib/web_video_player/web_video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class _WebVideoPlayerState extends State<WebVideoPlayer> {
void initState() {
super.initState();
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.network(mockData["items"][1]["trailer_url"]),
videoPlayerController: VideoPlayerController.networkUrl(
Uri.parse(mockData["items"][1]["trailer_url"])),
);
List<String> urls = (mockData["items"] as List)
.map<String>((item) => item["trailer_url"])
Expand Down
6 changes: 4 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import FlutterMacOS
import Foundation

import package_info_plus
import path_provider_foundation
import video_player_avfoundation
import wakelock_macos
import wakelock_plus

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
}
2 changes: 1 addition & 1 deletion example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading

0 comments on commit 561b0e3

Please sign in to comment.