Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +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.
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
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion example/ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9a6723ad18e3f950fccdc81adda11616
f1df2ffda6f2083c9121914530433089
58 changes: 42 additions & 16 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/material.dart';
Expand Down Expand Up @@ -28,6 +29,8 @@ class MyAppScaffoldState extends State<MyAppScaffold> {
VlcPlayerController _videoViewController;
VlcPlayerController _videoViewController2;
bool isPlaying = true;
double sliderValue = 0.0;
double currentPlayerTime = 0;

@override
void initState() {
Expand All @@ -45,6 +48,18 @@ class MyAppScaffoldState extends State<MyAppScaffold> {
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();
}

Expand Down Expand Up @@ -94,12 +109,24 @@ class MyAppScaffoldState extends State<MyAppScaffold> {
),
),
),
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();
});
//convert 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(
Expand Down Expand Up @@ -134,20 +161,19 @@ class MyAppScaffoldState extends State<MyAppScaffold> {
}

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 {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions ios/Classes/SwiftFlutterVlcPlayerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down