aves_mio1/lib/widgets/viewer/video/remote_video_factory.dart
FabioMich66 084fa184da
Some checks failed
Quality check / Flutter analysis (push) Has been cancelled
Quality check / CodeQL analysis (java-kotlin) (push) Has been cancelled
ok con video e foto in galleria aves
2026-03-17 12:19:38 +01:00

31 lines
1 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:aves/remote/remote_http.dart';
import 'package:aves/model/entry/entry.dart'; // AvesEntry concreto (path/remotePath)
import 'package:aves_model/aves_model.dart'; // ✅ espone AvesEntryBase
import 'package:aves_video/aves_video.dart';
class RemoteVideoControllerFactory implements AvesVideoControllerFactory {
@override
void init() {
// opzionale (warm-up o logging)
}
@override
AvesVideoController buildController(
AvesEntryBase entry, {
required PlaybackStateHandler playbackStateHandler,
required VideoSettings settings,
}) {
// Nel tuo app layer lentry è AvesEntry concreto (per path/remotePath)
final e = entry as AvesEntry;
final url = RemoteHttp.absUrl(e.remotePath ?? e.path);
return RemoteNetworkVideoController(
entry,
url: url,
// se la cache non è popolata, il controller farà RemoteHttp.headers()
httpHeaders: RemoteHttp.peekHeaders(),
playbackStateHandler: playbackStateHandler,
settings: settings,
);
}
}