Package org.opencastproject.mediapackage
Class AdaptivePlaylist.HLSMediaPackageCheck
java.lang.Object
org.opencastproject.mediapackage.AdaptivePlaylist.HLSMediaPackageCheck
- Enclosing interface:
AdaptivePlaylist
Fix HLS playlists/media already in the workspace as the result of an ingest This builds the hierarchies of a HLS
playlist with masters as the roots. This is useful if mixed files are ingested into a mediapackage. HLS files with
relative links will fail in an inspection unless the relative paths are fixed. Logical names should be preserved if
they exists.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanrewriteHLS(MediaPackage mp, BiFunction<File, Track, Track> replaceTrackFileInWS, Function<Track, Void> removeFromWS) Rewrite the playlist file from master on down, this has to be done in multiple steps because the act of putting a file into a collection changes the path and new path is not known in advance.
-
Constructor Details
-
HLSMediaPackageCheck
public HLSMediaPackageCheck(List<Track> tracks, Function<URI, File> getFileFromURI) throws IOException, MediaPackageException, URISyntaxExceptionBuilds a map of files in the mediapackage so that it can be analyzed and fixed if needed- Parameters:
tracks- - list of tracks from a media packagegetFileFromURI- - a function to get files from the media package by URI- Throws:
IOException- if can't read fileURISyntaxException- if bad URIMediaPackageException- - if mediapackage is incomplete and missing segments
-
-
Method Details
-
needsRewriting
public boolean needsRewriting() -
rewriteHLS
public List<Track> rewriteHLS(MediaPackage mp, BiFunction<File, Track, throws MediaPackageExceptionTrack> replaceTrackFileInWS, Function<Track, Void> removeFromWS) Rewrite the playlist file from master on down, this has to be done in multiple steps because the act of putting a file into a collection changes the path and new path is not known in advance. The two functions are passed in to this function to manage the tracks in its storage- Parameters:
mp- to be rewrittemreplaceTrackFileInWS- A function that creates a new track with the file using the metadata in the track, returning a new track in the media package.removeFromWS- A function that removes() the track from the media package in the workspace- Returns:
- old tracks that are removed from the media package
- Throws:
MediaPackageException- if bad mp
-