DLNA/UPNP video cast error of DMR

1.1k views Asked by At

I am a iOS developer. Now I am developing DLNA/UPNP iOS application. My target is directly to cast video from iPhone to Samsung smart TV without any middleware. So I am using upnpx library for that. Wireframe is below. iPhone download videolink from server. And directly cast video to TV. Of course, server is not DMS. In here my issue is that some videos are played well on TV. But some videos are not played on TV. Only audio is played. What do I miss on implementing app? I hope to get best solution from everybody. Thank you.

This is how I selected DMR:

MediaRenderer1Device *render = (MediaRenderer1Device*)device;
        [[PlayBack GetInstance] setRenderer:render];
        [[PlayBack GetInstance] Play:0];

/*choosed DMR urn 'urn:schemas-upnp-org:device:MediaRenderer:1' */

//play func

-(int)Play:(NSInteger)position {

      if([[renderer  avTransportService]isObserver:BasicUPnPServiceObserver*)self]== NO){
            [[renderer avTransportService] addObserver:(BasicUPnPServiceObserver*)self];
        }  
        NSString *uri = @"http://parstvco.files.wordpress.com/2015/11/dandoon-tala-10.mp4"; // This uri will be played on TV(DMR)

        NSString *iid = @"0";

        [[renderer avTransport] SetPlayModeWithInstanceID:iid NewPlayMode:@"NORMAL"];

        [[renderer avTransport] SetAVTransportURIWithInstanceID:iid CurrentURI:uri      CurrentURIMetaData:@"video/mp4"];


        [[renderer avTransport] PlayWithInstanceID:iid Speed:@"1"];

}

//result log

2016-06-11 09:33:16.120 upnpxdemo[841:8340] Error (SoapAction): Got a non 200 response: 500. Data:

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>UPnPError</faultstring><detail><u:UPnPError xmlns:u="urn:schemas-upnp-org:control-1-0"><u:errorCode>701</u:errorCode><u:errorDescription>Transition not available</u:errorDescription></u:UPnPError></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
1

There are 1 answers

1
Jussi Kukkonen On

The error message is unlikely to be related to some videos not playing (I suspect that's just a codec incompatibility), but the following is for the error message:

AVTransport service may fail with 701 in several cases if it cannot make the state transition you ask for (e.g. if you try to Pause() while STOPPED). The AVTransport service definition document lists all the cases where a 701 may happen -- but of course your Samsung might be returning it in completely different situations as well :/

I can't see what in your code might trigger something described above but I suggest trying to monitor the TransportState of the service just before the call that fails with a 701: My guess is that the service is still e.g. TRANSITIONING and won't take commands until it's STOPPED or PLAYING.