feat: initialize new Flutter project with core feature structure and cross-platform configuration

This commit is contained in:
Ümit Tunç
2026-04-29 21:58:29 +03:00
parent 859460434d
commit 34c5b44ddf
149 changed files with 6882 additions and 0 deletions
@@ -0,0 +1,43 @@
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
abstract class ILinkExtractionService {
Future<String?> extractVideoUrl(String pageUrl);
}
class LinkExtractionService implements ILinkExtractionService {
HeadlessInAppWebView? _headlessWebView;
@override
Future<String?> extractVideoUrl(String pageUrl) async {
// 1. Check if it's already a video link
if (_isVideoUrl(pageUrl)) return pageUrl;
// 2. Use Headless WebView to find the video
String? foundUrl;
_headlessWebView = HeadlessInAppWebView(
initialUrlRequest: URLRequest(url: WebUri(pageUrl)),
onLoadResource: (controller, resource) {
final url = resource.url.toString();
if (_isVideoUrl(url)) {
foundUrl = url;
_headlessWebView?.dispose();
}
},
);
await _headlessWebView?.run();
// Wait for some time to catch resources
await Future.delayed(const Duration(seconds: 5));
return foundUrl;
}
bool _isVideoUrl(String url) {
final lower = url.toLowerCase();
return lower.contains('.m3u8') ||
lower.contains('.mp4') ||
lower.contains('.mkv');
}
}