RYGEL_EXAMPLE_PLAYER_PLAYBACK_STATE,
RYGEL_EXAMPLE_PLAYER_URI,
RYGEL_EXAMPLE_PLAYER_MIME_TYPE,
+ RYGEL_EXAMPLE_PLAYER_CAN_SEEK,
RYGEL_EXAMPLE_PLAYER_METADATA,
RYGEL_EXAMPLE_PLAYER_CONTENT_FEATURES,
RYGEL_EXAMPLE_PLAYER_VOLUME,
G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
+ RYGEL_EXAMPLE_PLAYER_CAN_SEEK,
+ g_param_spec_boolean ("can-seek",
+ "can-seek",
+ "can-seek",
+ FALSE,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
+
+ g_object_class_install_property (gobject_class,
RYGEL_EXAMPLE_PLAYER_CONTENT_FEATURES,
g_param_spec_string ("content-features",
"content-features",
case RYGEL_EXAMPLE_PLAYER_POSITION:
g_value_set_int64 (value, rygel_media_player_get_position (base));
break;
+ case RYGEL_EXAMPLE_PLAYER_CAN_SEEK:
+ g_value_set_boolean (value, FALSE);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
/// The mime-type of the currently-playing media
public abstract string? mime_type { owned get; set; }
+ /// The current media supports time-based seeking
+ public abstract bool can_seek { get; }
+
/**
* The contents of the contentFeatures.dlna.org HTTP header,
* containing the 4th field of the protocol info for the current
public string current_transport_actions {
owned get {
+ string actions = null;
switch (this._playback_state) {
case "PLAYING":
case "TRANSITIONING":
- return "Stop,Seek,X_DLNA_SeekTime,Pause";
+ actions = "Stop,Seek,Pause";
+ break;
case "STOPPED":
case "PAUSED_PLAYBACK":
- return "Play,Seek,X_DLNA_SeekTime";
+ actions = "Play,Seek";
+ break;
default:
- return "";
+ break;
}
+ if (actions != null && this.player.can_seek) {
+ actions += ",X_DLNA_SeekTime";
+ }
+
+ if (actions == null) {
+ return "";
+ }
+
+ return actions;
}
}