From 1a1ea416f66dadb146d93b230ab6234003ed5ee8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 21 Jan 2015 12:27:15 -0800 Subject: Also check to make sure that the server support REL_TIME seeking --- src/github/daneren2005/dsub/service/DLNAController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java index 24cd3030..6a288e8a 100644 --- a/src/github/daneren2005/dsub/service/DLNAController.java +++ b/src/github/daneren2005/dsub/service/DLNAController.java @@ -27,6 +27,7 @@ import org.fourthline.cling.model.gena.GENASubscription; import org.fourthline.cling.model.message.UpnpResponse; import org.fourthline.cling.model.meta.Action; import org.fourthline.cling.model.meta.Service; +import org.fourthline.cling.model.meta.StateVariable; import org.fourthline.cling.model.state.StateVariableValue; import org.fourthline.cling.model.types.ServiceType; import org.fourthline.cling.support.avtransport.callback.GetPositionInfo; @@ -107,10 +108,13 @@ public class DLNAController extends RemoteController { @Override protected void established(GENASubscription genaSubscription) { - Action[] actions = genaSubscription.getService().getActions(); - for(Action action: actions) { - if("Seek".equals(action.getName())) { - supportsSeek = true; + Action seekAction = genaSubscription.getService().getAction("Seek"); + if(seekAction != null) { + StateVariable seekMode = genaSubscription.getService().getStateVariable("A_ARG_TYPE_SeekMode"); + for(String allowedValue: seekMode.getTypeDetails().getAllowedValues()) { + if("REL_TIME".equals(allowedValue)) { + supportsSeek = true; + } } } -- cgit v1.2.3