Skip to content

Commit

Permalink
0.6.0 commit for no scoped storage build
Browse files Browse the repository at this point in the history
  • Loading branch information
lrorpilla committed Apr 4, 2021
1 parent cb92796 commit 47b95fe
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">A mobile video player tailored for Japanese language learners.</p>

<p align="center" style="margin:0"><b>Latest GitHub Release:<br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.5.2-beta">0.5.2-beta 🇯🇵 → 🇬🇧</a><br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.6.0-beta">0.6.0-beta 🇯🇵 → 🇬🇧</a><br>
<a href="https://github.com/lrorpilla/jidoujisho/releases/tag/0.5.3-enjp-beta">0.5.3-beta 🇬🇧 → 🇯🇵</a></b><br></p>

# 📚 Uninterrupted language immersion at your fingertips
Expand Down
3 changes: 2 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

-keep class com.arthenica.mobileffmpeg.AbiDetect {
native <methods>;
}
}
-keep class org.videolan.libvlc.** { *; }
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="jidoujisho"
android:icon="@mipmap/launcher_icon"
Expand Down
28 changes: 12 additions & 16 deletions chewie-0.12.2/lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,26 +355,22 @@ class ChewieController extends ChangeNotifier {
bool get isPlaying => videoPlayerController.value.isPlaying;

Future _initialize() async {
if ((autoInitialize || autoPlay) &&
!videoPlayerController.value.isInitialized) {
videoPlayerController.initialize();
}
// if ((autoInitialize || autoPlay) &&
// !videoPlayerController.value.isInitialized) {
// videoPlayerController.initialize();
// }

if (autoPlay) {
if (fullScreenByDefault) {
enterFullScreen();
}
// await videoPlayerController.setLooping(looping);

await videoPlayerController.play();
}
// if (startAt != null) {
// await videoPlayerController.seekTo(startAt);
// }

if (startAt != null) {
await videoPlayerController.seekTo(startAt);
}
// if (fullScreenByDefault) {
// videoPlayerController.addListener(_fullScreenListener);
// }

if (fullScreenByDefault) {
videoPlayerController.addListener(_fullScreenListener);
}
// await videoPlayerController.play();
}

Future<void> _fullScreenListener() async {
Expand Down
3 changes: 1 addition & 2 deletions chewie-0.12.2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ environment:

dependencies:
audioplayers:
file_picker:
flutter:
sdk: flutter
flutter_ffmpeg:
flutter_vlc_player: ^6.0.1
flutter_vlc_player:
intl:
jidoujisho:
path: ../
Expand Down
3 changes: 1 addition & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:async/async.dart';
import 'package:file_picker/file_picker.dart';
import 'package:gx_file_picker/gx_file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fuzzy/fuzzy.dart';
Expand Down Expand Up @@ -39,7 +39,6 @@ Map<String, AsyncMemoizer> captioningCache = {};
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIOverlays([]);
await FilePicker.platform.clearTemporaryFiles();

PackageInfo packageInfo = await PackageInfo.fromPlatform();
appName = packageInfo.appName;
Expand Down
40 changes: 19 additions & 21 deletions lib/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import 'dart:io';

import 'package:chewie/chewie.dart';
import 'package:clipboard_monitor/clipboard_monitor.dart';
import 'package:file_picker/file_picker.dart';
import 'package:gx_file_picker/gx_file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
import 'package:http/http.dart' as http;
import 'package:jidoujisho/main.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
import 'package:subtitle_wrapper_package/data/models/style/subtitle_style.dart';
import 'package:subtitle_wrapper_package/data/models/subtitle.dart';
Expand All @@ -25,11 +24,6 @@ class Player extends StatelessWidget {

@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);

SystemChrome.setEnabledSystemUIOverlays([]);
Wakelock.enable();

Expand All @@ -43,19 +37,15 @@ class Player extends StatelessWidget {

Widget localPlayer() {
return new FutureBuilder(
future: FilePicker.platform.pickFiles(
type: Platform.isIOS ? FileType.any : FileType.video,
allowMultiple: false,
allowCompression: false,
),
builder:
(BuildContext context, AsyncSnapshot<FilePickerResult> snapshot) {
future: FilePicker.getFile(
type: Platform.isIOS ? FileType.any : FileType.video),
builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return loadingCircle();
default:
if (snapshot.hasData) {
File videoFile = File(snapshot.data.files.single.path);
File videoFile = snapshot.data;
print("VIDEO FILE: ${videoFile.path}");

return FutureBuilder(
Expand All @@ -70,6 +60,11 @@ class Player extends StatelessWidget {
String defaultSubtitles =
getDefaultSubtitles(videoFile, internalSubs);

SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);

return VideoPlayer(
videoFile: videoFile,
internalSubs: internalSubs,
Expand Down Expand Up @@ -148,6 +143,11 @@ class Player extends StatelessWidget {
internalSubs = extractWebSubtitle(webSubtitles);
}

SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);

return VideoPlayer(
webStream: webStream,
defaultSubtitles: webSubtitles,
Expand Down Expand Up @@ -464,21 +464,19 @@ class _VideoPlayerState extends State<VideoPlayer> {
}

void playExternalSubtitles() async {
FilePickerResult result = await FilePicker.platform.pickFiles(
File result = await FilePicker.getFile(
type: FileType.any,
allowMultiple: false,
);

if (result != null) {
File subFile = File(result.files.single.path);
if (subFile.path.endsWith("srt")) {
if (result.path.endsWith("srt")) {
getSubtitleWrapper()
.subtitleController
.updateSubtitleContent(content: subFile.readAsStringSync());
.updateSubtitleContent(content: result.readAsStringSync());
print("SUBTITLES SWITCHED TO EXTERNAL SRT");
} else {
getSubtitleWrapper().subtitleController.updateSubtitleContent(
content: await extractNonSrtSubtitles(subFile));
content: await extractNonSrtSubtitles(result));
print("SUBTITLES SWITCHED TO EXTERNAL ASS");
}
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A mobile video player tailored for Japanese language learners.

publish_to: none

version: 0.5.4+beta
version: 0.6.0+beta

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -16,7 +16,7 @@ dependencies:
chewie:
path: ./chewie-0.12.2
device_info:
file_picker: <=3.0.1
gx_file_picker:
flutter_vlc_player: ^6.0.1
clipboard_monitor: ^0.9.1
unofficial_jisho_api: ^1.1.0
Expand Down

0 comments on commit 47b95fe

Please sign in to comment.