aves_mio18/lib/widgets/viewer/video/remote_video_factory.dart
2026-04-14 09:53:02 +02: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,
);
}
}