How to Cast Big video from android device to TV programmatically?

Viewed 67

I am trying to Cast my files (Video/Images etc etc..) Android Device to TV. The small size videos are cast successfully mobile to tv but the huge size files are not its showing error while cast time.

I added code example and error screenshot to below. please let me know if do you have a idea on that type of issue.

Thanks in advance.

public void start(final DLNAControlCallback dLNAControlCallback) {
    if (this.mMediaInfo.getMediaType() == 4) {
        startMirror(dLNAControlCallback);
        return;
    }
    this.mDeviceInfo.setMediaID(this.mMediaInfo.getMediaId());
    String pushMediaToRender = pushMediaToRender(this.mMediaInfo);
    Service findService = this.mDevice.findService(this.AV_TRANSPORT_SERVICE);
    if (findService == null) {
        dLNAControlCallback.onFailure(null, 5, null);
    } else {
        execute(new SetAVTransportURI(findService, this.mMediaInfo.getUri(), pushMediaToRender) {
            @Override
            public void success(ActionInvocation actionInvocation) {
                super.success(actionInvocation);
                play(dLNAControlCallback);
            }

            @Override
            public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String str) {
                DLNAManager.logE("play error:" + str);
                currentState = 5;
                mDeviceInfo.setState(5);
                dLNAControlCallback.onFailure(actionInvocation, 4, str);
            }
        });
    }
}



    public void play(final DLNAControlCallback dLNAControlCallback) {
    Service findService = this.mDevice.findService(this.AV_TRANSPORT_SERVICE);
    if (checkErrorBeforeExecute(1, findService, dLNAControlCallback)) {
        return;
    }
    execute(new Play(findService) {
        @Override
        public void success(ActionInvocation actionInvocation) {
            super.success(actionInvocation);
            currentState = 1;
            dLNAControlCallback.onSuccess(actionInvocation);
            mDeviceInfo.setState(1);
        }

        @Override
        public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String str) {
            DLNAManager.logE("play error:" + str);
            currentState = 5;
            dLNAControlCallback.onFailure(actionInvocation, 4, str);
            mDeviceInfo.setState(5);
        }
    });
}

Its Go inside failure method.

enter image description here

ERROR :

D/DLNAManager: tryTransformLocalMediaAddressToLocalHttpServerAddress ,sourceUrl : /storage/emulated/0/DCIM/aaa/Th0r-.L0ve.@nd.Thunder.2022.IMAX.1080p.HIN-3NG.5.1.x264-K@tm0v!eHD.rs.mkv
D/DLNAManager: tryTransformLocalMediaAddressToLocalHttpServerAddress ,newSourceUrl : http://192.168.29.209:9578/DCIM/aaa/Th0r-.L0ve.@nd.Thunder.2022.IMAX.1080p.HIN-3NG.5.1.x264-K@tm0v!eHD.rs.mkv
D/DLNAManager: tryTransformLocalMediaAddressToLocalHttpServerAddress ,encodeNewSourceUrl : http://192.168.29.209:9578/DCIM/aaa/Th0r-.L0ve.%40nd.Thunder.2022.IMAX.1080p.HIN-3NG.5.1.x264-K%40tm0v%21eHD.rs.mkv
E/DLNAManager: protocolinfo: protocolInfo="http-get:*:*/*:*"
E/DLNAManager: metadata: <?xml version="1.0" encoding="utf-8" standalone="no"?><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"><item id="L3N0b3JhZ2UvZW11bGF0ZWQvMC9EQ0lNL2FhYS9UaDByLS5MMHZlLkBuZC5UaHVuZGVyLjIwMjIuSU1BWC4xMDgwcC5ISU4tM05HLjUuMS54MjY0LUtAdG0wdiFlSEQucnMubWt2" parentID="0" restricted="0"><dc:title>Th0r-.L0ve.@nd.Thunder.2022.IMAX.1080p.HIN-3NG.5.1.x264-K@tm0v!eHD.rs.mkv</dc:title><upnp:artist>unknow</upnp:artist><upnp:class>object.item.imageItem</upnp:class><dc:date>2022-09-16T16:25:29</dc:date><res protocolInfo="http-get:*:*/*:*"  >http://192.168.29.209:9578/DCIM/aaa/Th0r-.L0ve.%40nd.Thunder.2022.IMAX.1080p.HIN-3NG.5.1.x264-K%40tm0v%21eHD.rs.mkv</res></item></DIDL-Lite>
E/g.protocol.sync.ReceivingEvent: Invalid subscription ID, no active subscription: (IncomingEventRequestMessage) NOTIFY /upnp/dev/1ead7400-3578-7c66-f9a7-1d9ce0920251/svc/upnp-org/AVTransport/event/cb SEQUENCE: 18
E/DLNAManager: play error:Error: Transition not available (HTTP response was: 500 Internal Server Error)
W/ing.transport.spi.StreamClient: HTTP request took a long time (30316ms): (OutgoingActionRequestMessage) POST http://192.168.29.206:1043/AVTransport/1ead7400-3578-7c66-f9a7-1d9ce0920251/control.xml
E/DLNAManager: play error:Error: Action Failed (HTTP response was: 500 Internal Server Error)
0 Answers
Related