SourceResolver typedef

SourceResolver = FutureOr<String?> Function(SourceResolveRequest request)

Resolves the URL mpv should actually open for a playlist entry, invoked by the library right before each stream open (and once more after a failed open, so an expired URL can be refreshed).

Return the URL to play, or null (or the unchanged SourceResolveRequest.uri) to keep the current one. Install with Player.setSourceResolver.

Implementation

typedef SourceResolver = FutureOr<String?> Function(
  SourceResolveRequest request,
);