From f2a242918d0e76e00a27fedcd11df17fa4829d8b Mon Sep 17 00:00:00 2001 From: mitch Date: Sat, 23 May 2020 22:37:52 -0400 Subject: [PATCH 1/9] Bugfix for https://github.com/solid-software/flutter_vlc_player/issues/52 Bugfix --- .../software/solid/fluttervlcplayer/FlutterVideoView.java | 4 ++-- example/android/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/software/solid/fluttervlcplayer/FlutterVideoView.java b/android/src/main/java/software/solid/fluttervlcplayer/FlutterVideoView.java index 77918b92..56e791a0 100755 --- a/android/src/main/java/software/solid/fluttervlcplayer/FlutterVideoView.java +++ b/android/src/main/java/software/solid/fluttervlcplayer/FlutterVideoView.java @@ -165,7 +165,7 @@ public void onMethodCall(MethodCall methodCall, @NonNull MethodChannel.Result re vout.attachViews(); String initStreamURL = methodCall.argument("url"); - Media media = new Media(libVLC, Uri.parse(Uri.decode(initStreamURL))); + Media media = new Media(libVLC, Uri.parse(initStreamURL)); mediaPlayer.setMedia(media); result.success(null); @@ -178,7 +178,7 @@ public void onMethodCall(MethodCall methodCall, @NonNull MethodChannel.Result re mediaPlayer.stop(); String newURL = methodCall.argument("url"); - Media newMedia = new Media(libVLC, Uri.parse(Uri.decode(newURL))); + Media newMedia = new Media(libVLC, Uri.parse(newURL)); mediaPlayer.setMedia(newMedia); result.success(null); diff --git a/example/android/build.gradle b/example/android/build.gradle index 4874c0a6..91c94778 100755 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:3.6.3' } } From c785f1828caab847096eeec4ecd88b406c18c23d Mon Sep 17 00:00:00 2001 From: mitch Date: Sat, 23 May 2020 22:38:55 -0400 Subject: [PATCH 2/9] spec bump --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 92ded1c0..9a28f6db 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_vlc_player description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen. -version: 3.0.0 +version: 3.0.1 homepage: https://github.com/solid-software/flutter_vlc_player environment: From c5629d9895293764f52ccd6551f9648efa887426 Mon Sep 17 00:00:00 2001 From: mitch Date: Sun, 24 May 2020 11:51:02 -0400 Subject: [PATCH 3/9] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 659dd630..7d11ad3b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.1 +* Fix a bug on Android with URL parsing. See (https://github.com/solid-software/flutter_vlc_player/issues/52), +credits to pharshdev (https://github.com/pharshdev) and Mitch Ross (https://github.com/mitchross) + ## 3.0.0 * Migrated to Swift, thanks to Mitch Ross (https://github.com/mitchross), Amadeu Cavalcante (https://github.com/amadeu01) and pharshdev (https://github.com/pharshdev). From 9aac8d954d0e2df19d17a92b0e879519f5a966ea Mon Sep 17 00:00:00 2001 From: mitch Date: Fri, 29 May 2020 12:13:09 -0400 Subject: [PATCH 4/9] bugfix, podspec update --- ios/flutter_vlc_player.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/flutter_vlc_player.podspec b/ios/flutter_vlc_player.podspec index 7f225b72..a742a642 100755 --- a/ios/flutter_vlc_player.podspec +++ b/ios/flutter_vlc_player.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_vlc_player' - s.version = '3.0.0' + s.version = '3.0.1' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A VLC-powered alternative to Flutter video_player. Supports multiple players on one screen. @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.dependency 'Flutter' s.platform = :ios, '9.0' - s.dependency 'MobileVLCKit', '~> 3.3.11' + s.dependency 'MobileVLCKit', '~> 3.3.12' s.static_framework = true # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. From c1ab9a4070e6c1990ec831c4deb10db7b2465120 Mon Sep 17 00:00:00 2001 From: mitch Date: Fri, 29 May 2020 12:53:22 -0400 Subject: [PATCH 5/9] Changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d11ad3b..eae06f7d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.1 +* Updates MobileVLC to fix a bug on ios with HLS Streaming on VLCKit itself. See (https://code.videolan.org/videolan/VLCKit/-/issues/368), +credits to Mitch Ross (https://github.com/mitchross) + ## 3.0.1 * Fix a bug on Android with URL parsing. See (https://github.com/solid-software/flutter_vlc_player/issues/52), credits to pharshdev (https://github.com/pharshdev) and Mitch Ross (https://github.com/mitchross) From 6b07983e909b8127551ff2f928612b2ebd310b24 Mon Sep 17 00:00:00 2001 From: mitch Date: Fri, 29 May 2020 13:02:57 -0400 Subject: [PATCH 6/9] Updates version --- ios/flutter_vlc_player.podspec | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/flutter_vlc_player.podspec b/ios/flutter_vlc_player.podspec index a742a642..3d23dac3 100755 --- a/ios/flutter_vlc_player.podspec +++ b/ios/flutter_vlc_player.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_vlc_player' - s.version = '3.0.1' + s.version = '3.0.2' s.summary = 'A new flutter plugin project.' s.description = <<-DESC A VLC-powered alternative to Flutter video_player. Supports multiple players on one screen. diff --git a/pubspec.yaml b/pubspec.yaml index 9a28f6db..8990e490 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_vlc_player description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen. -version: 3.0.1 +version: 3.0.2 homepage: https://github.com/solid-software/flutter_vlc_player environment: From f9bd87d4e5cb520be07ddb6db3bb0cae25263d04 Mon Sep 17 00:00:00 2001 From: mitch ross Date: Tue, 7 Jul 2020 10:21:28 -0400 Subject: [PATCH 7/9] Create Video Seek Example --- example/android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- example/lib/main.dart | 60 ++++++++++++++----- example/pubspec.yaml | 2 +- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/example/android/build.gradle b/example/android/build.gradle index 91c94778..992f1a99 100755 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.android.tools.build:gradle:4.0.0' } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 534fb274..486181e0 100755 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Mar 11 22:39:55 EDT 2020 +#Mon Jul 06 16:18:01 EDT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/example/lib/main.dart b/example/lib/main.dart index 208f588c..f90850d5 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/material.dart'; @@ -28,6 +29,8 @@ class MyAppScaffoldState extends State { VlcPlayerController _videoViewController; VlcPlayerController _videoViewController2; bool isPlaying = true; + double sliderValue = 0.0; + double currentPlayerTime = 0; @override void initState() { @@ -45,6 +48,18 @@ class MyAppScaffoldState extends State { setState(() {}); }); + Timer.periodic(Duration(seconds: 1), (Timer timer) { + String state = _videoViewController2.playingState.toString(); + if (this.mounted) { + setState(() { + if (state == "PlayingState.PLAYING" && + sliderValue < _videoViewController2.duration.inSeconds) { + sliderValue = _videoViewController2.position.inSeconds.toDouble(); + } + }); + } + }); + super.initState(); } @@ -94,12 +109,26 @@ class MyAppScaffoldState extends State { ), ), ), - FlatButton( - child: isPlaying ? Icon(Icons.pause) : Icon(Icons.play_arrow) , - onPressed: () => { - playOrPauseVideo() - } + Slider( + activeColor: Colors.white, + value: sliderValue, + min: 0.0, + max: _videoViewController2.duration == null + ? 1.0 + : _videoViewController2.duration.inSeconds.toDouble(), + onChanged: (progress) { + setState(() { + sliderValue = progress.floor().toDouble(); + print('set state: $sliderValue'); + }); + print('set time: $sliderValue'); + //conver to Milliseconds since VLC requires MS to set time + _videoViewController2.setTime(sliderValue.toInt() * 1000); + }, ), + FlatButton( + child: isPlaying ? Icon(Icons.pause) : Icon(Icons.play_arrow), + onPressed: () => {playOrPauseVideo()}), FlatButton( child: Text("Change URL"), onPressed: () => _videoViewController.setStreamUrl( @@ -134,20 +163,19 @@ class MyAppScaffoldState extends State { } void playOrPauseVideo() { - String state = _videoViewController.playingState.toString(); - - if ( state == "PlayingState.PLAYING" ){ - _videoViewController.pause(); - setState(() { - isPlaying = false; - }); + String state = _videoViewController2.playingState.toString(); + + if (state == "PlayingState.PLAYING") { + _videoViewController2.pause(); + setState(() { + isPlaying = false; + }); } else { - _videoViewController.play(); - setState(() { + _videoViewController2.play(); + setState(() { isPlaying = true; - }); + }); } - } void _createCameraImage() async { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fcf9fd92..0e73202a 100755 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the flutter_vlc_player plugin. publish_to: 'none' environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: ">=2.2.0 <3.0.0" dependencies: flutter: From 48db45c56397298db6cbaebce240cce7e0656f54 Mon Sep 17 00:00:00 2001 From: mitch Date: Tue, 7 Jul 2020 11:59:49 -0400 Subject: [PATCH 8/9] Fix seek time on iOS. Add Seekbar to demo app. --- CHANGELOG.md | 4 ++++ example/ios/Flutter/.last_build_id | 2 +- ios/Classes/SwiftFlutterVlcPlayerPlugin.swift | 7 +++++-- pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e4a325..ee0ce971 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.3 +* Updates MobileVLC to fix a bug on ios with Seek Time. See (https://github.com/solid-software/flutter_vlc_player/issues/72). Also adds seek bar to example player for demonstration purposes. +credits to Mitch Ross (https://github.com/mitchross) + ## 3.0.2 * Updates MobileVLC to fix a bug on ios with HLS Streaming on VLCKit itself. See (https://code.videolan.org/videolan/VLCKit/-/issues/368), credits to Mitch Ross (https://github.com/mitchross) diff --git a/example/ios/Flutter/.last_build_id b/example/ios/Flutter/.last_build_id index 69faea91..536e0527 100755 --- a/example/ios/Flutter/.last_build_id +++ b/example/ios/Flutter/.last_build_id @@ -1 +1 @@ -9a6723ad18e3f950fccdc81adda11616 \ No newline at end of file +f1df2ffda6f2083c9121914530433089 \ No newline at end of file diff --git a/ios/Classes/SwiftFlutterVlcPlayerPlugin.swift b/ios/Classes/SwiftFlutterVlcPlayerPlugin.swift index b2a717ba..62a8036b 100755 --- a/ios/Classes/SwiftFlutterVlcPlayerPlugin.swift +++ b/ios/Classes/SwiftFlutterVlcPlayerPlugin.swift @@ -134,9 +134,12 @@ public class VLCView: NSObject, FlutterPlatformView { return case .setTime: - - let time = VLCTime(number: arguments["time"] as? NSNumber) + let setTimeInMillisecondsAsString = arguments["time"] as? String + let newTime = NSNumber(value:(setTimeInMillisecondsAsString! as NSString).doubleValue) + let time = VLCTime(number: newTime ) self.player.time = time + + result(nil) return diff --git a/pubspec.yaml b/pubspec.yaml index 8990e490..9efee0d2 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_vlc_player description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen. -version: 3.0.2 +version: 3.0.3 homepage: https://github.com/solid-software/flutter_vlc_player environment: From 29ef030f4ffea652d49237ce2a1f8ed65cf103c9 Mon Sep 17 00:00:00 2001 From: mitch ross Date: Wed, 8 Jul 2020 17:16:51 -0400 Subject: [PATCH 9/9] PR comments --- CHANGELOG.md | 4 ++-- example/lib/main.dart | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0ce971..53a9e571 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ ## 3.0.3 -* Updates MobileVLC to fix a bug on ios with Seek Time. See (https://github.com/solid-software/flutter_vlc_player/issues/72). Also adds seek bar to example player for demonstration purposes. +* Updates MobileVLC to fix a bug on iOS with Seek Time. See (https://github.com/solid-software/flutter_vlc_player/issues/72). Also adds seek bar to example player for demonstration purposes. credits to Mitch Ross (https://github.com/mitchross) ## 3.0.2 -* Updates MobileVLC to fix a bug on ios with HLS Streaming on VLCKit itself. See (https://code.videolan.org/videolan/VLCKit/-/issues/368), +* Updates MobileVLC to fix a bug on iOS with HLS Streaming on VLCKit itself. See (https://code.videolan.org/videolan/VLCKit/-/issues/368), credits to Mitch Ross (https://github.com/mitchross) ## 3.0.1 diff --git a/example/lib/main.dart b/example/lib/main.dart index f90850d5..bf5646a1 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -119,10 +119,8 @@ class MyAppScaffoldState extends State { onChanged: (progress) { setState(() { sliderValue = progress.floor().toDouble(); - print('set state: $sliderValue'); }); - print('set time: $sliderValue'); - //conver to Milliseconds since VLC requires MS to set time + //convert to Milliseconds since VLC requires MS to set time _videoViewController2.setTime(sliderValue.toInt() * 1000); }, ),