DLNA(二)

接:DLNA(一)
下面我们来看看具体的控制(这里还是以悦me为例

具体的代码见gitHubDemo里面的具体的包括实现都有具体的实现

服务动作请求

1.设置图片的播放

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            http://pic2.nipic.com/20090506/2256386_141149004_2.jpg
            <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:sec="http://www.sec.co.kr/"><item id="filePath" parentID="0" restricted="1"><upnp:class>object.item.imageItem</upnp:class><dc:title>
            IMAG1466</dc:title><dc:creator>Unknown Artist</dc:creator><upnp:artist>Unknown Artist</upnp:artist><upnp:albumArtURI>http://IP:PORT/filePath</upnp:albumArtURI><upnp:album>Unknown Album</upnp:album><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://IP:PORT/filePath</res></item></DIDL-Lite>
        
    


//返回response

    
        
    

2.图片开始播放

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            1
        
    


//response

    
        
    

3.获取当前图片播放信息

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
        
    


//response

    
        
            NO_MEDIA_PRESENT
            OK
            1
        
    

4.停止图片播放

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
        
    


//response

    
        
    

5.设置视频播放

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
            <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item id="f-0" parentID="0" restricted="0"><dc:title>Video</dc:title><dc:creator>Anonymous</dc:creator><upnp:class>object.item.videoItem</upnp:class><res protocolInfo="http-get:*:video/*:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" sec:URIType="public">%@</res></item></DIDL-Lite>
        
    


//response

    
        
    

6.获取当前视频播放信息

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
        
    


//response

    
        
            NO_MEDIA_PRESENT
            OK
            1
        
    

7.视频播放指令

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            1
        
    



//response

    
        
    

8.获取音量

http://192.168.124.43:1266/RenderingControl/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            Master
        
    


//response

    
        
            100
        
    

9.设置音量

http://192.168.124.43:1266/RenderingControl/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            Master
            5
        
    


//response

    
        
    

10.暂停视频指令

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
        
    


//response

    
        
    

11.播放快进退

http://192.168.124.43:1266/AVTransport/skyworth&208B3756FFED&192.168.124.43/control.xml


    
        
            0
            REL_TIME
            00:01:44
        
    


//response

    
        
    

上述对于基本的控制指令都有了,发现要实现网络的都应该没问题了,但是老大需要我去实现本地的图片/视频的播放,结果还是得用其他的方式将本地的资源变成http的方式来访问。
详见 DLNA(三)

友情链接:

  • gitHub_DLNA
  • DLNA(一)
  • DLNA(三)

你可能感兴趣的:(DLNA(二))