This directory contains an application that uses media and Flutter to create a media player.
Run the app as follows:
present_view mediaplayer_flutter
The initial screen is a menu of content items that can be played, unless the config file contains only one asset, in which case the chooser screen is skipped. Touch one of the items to play it. Note that the default config file contains only one item.
The app will look for config files in two places, reading only the first file it finds:
Here's an example config file:
[ { "uri": "http://192.168.4.1/big_buck_bunny.ogv", "title": "Big Buck Bunny" }, { "uri": "http://192.168.4.1/policehelicopter.ogg", "title": "Police Helicopter", "artist": "The Red Hot Chili Peppers", "album": "The Red Hot Chili Peppers", "loop": "true" }, { "uri": "http://192.168.4.1/superstition.ogg", "title": "Superstition", "artist": "Stevie Wonder", "album": "At the Close of the Century Disc 2" }, { "title": "Both Songs", "children": [ { "uri": "http://192.168.4.1/policehelicopter.ogg", "title": "Police Helicopter", "artist": "The Red Hot Chili Peppers", "album": "The Red Hot Chili Peppers" }, { "uri": "http://192.168.4.1/superstition.ogg", "title": "Superstition", "artist": "Stevie Wonder", "album": "At the Close of the Century Disc 2" } ] } ]
The config file must be well-formed JSON specifying an array of objects. An object describes a movie, a song or a playlist of movies and songs.
The following object fields are supported:
Specifies the URI from which to obtain the content. The file scheme is supported for files on the device. This field is required for movies and songs and prohibited for playlists.
Specifies an array of items to populate this item, which must be a playlist. This field is required for playlists and prohibited for all other item types.
Specifies the type of the item, one of “movie”, “music” or “playlist”. This field is optional. If it's absent, the app will attempt to infer the type of the content.
The title of the item. This field is optional. If it's absent, the item will be titled “(untitled)” in the content chooser. During playback, the app will attempt to get the title from the content, if applicable.
The name of the artist who created the content. This field is optional.
The name of the album on which the content appears. This field is optional.
Whether the item should be looped. This field is optional. Playlists can be looped.