diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2013-07-25 12:50:58 +0200 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2013-07-25 13:13:19 +0200 |
commit | 2a52c4789077512ce8ad5b7213a3771c92b44411 (patch) | |
tree | 3521c8a101e37a5faf2f6273a6ce5bce538b06b8 /examples | |
parent | 2df8981679d3226489e705726adf7f1572229ffd (diff) | |
download | clutter-gst-2a52c4789077512ce8ad5b7213a3771c92b44411.tar.gz |
Handle both uris and local files
Currently it's impossible to play a file from the internet with the
video-player example. Solve this by recognizing whether a filepath or a
uri was given and use the appropriate api depending on that.
https://bugzilla.gnome.org/show_bug.cgi?id=704854
Diffstat (limited to 'examples')
-rw-r--r-- | examples/video-player.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/video-player.c b/examples/video-player.c index b3e1317..5b6e49e 100644 --- a/examples/video-player.c +++ b/examples/video-player.c @@ -424,6 +424,7 @@ int main (int argc, char *argv[]) { const gchar *uri; + gchar *scheme; VideoApp *app = NULL; GstElement *pipe; GstElement *playsink; @@ -521,7 +522,13 @@ main (int argc, char *argv[]) NULL); /* Load up out video actor */ - clutter_gst_playback_set_filename (app->player, uri); + scheme = g_uri_parse_scheme (uri); + if (scheme != NULL) + clutter_gst_playback_set_uri (app->player, uri); + else + clutter_gst_playback_set_filename (app->player, uri); + + g_free (scheme); if (clutter_gst_playback_is_live_media (app->player)) g_print ("Playing live media\n"); |