Sign up here and you can log into the forum!

UMSP Plugin Development

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Re: UMSP Plugin Development   

Postby mad_ady » Sat May 04, 2013 11:11 am

Yes -I've noticed this as well. The wdtv upnp process is very permissive when parsing xml responses and will accept invalid responses (with unescaped characters). The only exception is the id string that needs to be escaped.

Other compliant upnp renderers will reject malformed xmls (like xbmc for example), so if you want your code to be playable on other players you'll need to make the changes discussed earlier (and live with xmlentities).
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Sat Mar 29, 2014 3:04 pm

Hello!
Looks like time to return to theme...
Now around Gen3 with Palace. and "&" escaped or not.
Strange things on WD with palace..
On old Live and 1.02 1.05 f/w into UMSP plugins have code with items and containers and ID's with &
e.g. umsp://plugins/name?url=http://url/?page=1&level=logos
normally worked on 1.02, 1.05 - No alarm messages about "..encoded: & should be encoded as &..." from umsp-test.php

Test on Streaming with latest Palace:
No alarm messages about "..encoded: & should be encoded as &..." from umsp-test.php
Worked from umsp-test but dont work on WD SMP - its stuck on containers with & ids.
If remake IDs in plugin to simple (without amp;):
e.g. umsp://plugins/name?url=http://url/?page=1&level=logos
it was normally work on SMP but have alarm message from umsp-test.php and I guess not work on 1.02,1.05 (check it - true) or via UMSP_LAN (dont check it)..

Looks like on UMSP 2.0 was auto convertation from & to & so its double... Need some rule to avoid double-code in one plugin for many platforms...

So, my opinion - UMSP 2.0 not must to do auto convertation from & to & (_xmlentities?) - this must do authors. Then one plugin was work on all platforms and via UMSP_LAN.

1018,1019 commits (recliq, mad_ady) is under great question... This changes not in public released wdlxtv firmwares, so 100% UMSP plugins work now, but if this changes go to public (like Palace) - we have a problem.

Quick fix as I say before :
Code: Select all
function _xmlentities($string) {
//    return str_replace(array("&", "<", ">", "\"", "'"),
//            array("&amp;", "&lt;", "&gt;", "&quot;", "&apos;"), $string);
return $string;
}

in function-upnp.php or full remove _xmlentities and change $encodedDIDL back to just $prmDIDL
WD TV Live (1.02.21-WDLXTV-0.4.7.3);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413; WMU219453404899; WMR161810775332
User avatar
DJArty
Developer
 
Posts: 540
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Sun Mar 30, 2014 10:25 pm

I agree, the _xmlentities function creates this mess. The need for it is not to allow unescaped special characters in the XMLs used by UMSP to communicate via DLNA. Those characters are breaking the XMLs sent by the WDTV (even if the WDTV's parser doesn't care), but other DLNA control points discard them as invalid.

At the time I made the implementation I looked for an elegant solution that didn't require any change in the plugins, but I didn't find any. The only option I was left with was to add the double decode option in the script - but this will fail if you send full URLs (or you can fix it by explicitly encoding your URLs before sending them.

I remember trying to add some logic to detect encoded strings and determining if they needed to be encoded or not. As far as I remember it didn't work as expecetd so I abandoned that idea and forced the encoding inside the UMSP code - when creating the xml if I remember correctly.

I'd like to enlist your help to brainstorm other ideas to make this work with fewer changes in user plugins, but while keeping the UMSP_LAN feature (e.g. the XMLs have to be valid).
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Mon Mar 31, 2014 12:37 am

As I say before plugin authors can look for correct urls,ids with escaped symbols.. and umsp-test.php help him with alarm messages.
What exactly situation need to convert into funcs-upnp.php, but cannot be converted before into source umsp plugin (one time for all platforms, avoid double decode etc.)?
WD TV Live (1.02.21-WDLXTV-0.4.7.3);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413; WMU219453404899; WMR161810775332
User avatar
DJArty
Developer
 
Posts: 540
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Mon Mar 31, 2014 12:59 am

So you're saying that I should escape the parameters when building the xml and unescape them when getting the response. I don't remember if I tried this... I'll have to look it up in the code. I think I tried it, but something broke - again, it's been almost 2 years since I made the changes...
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Mon Mar 31, 2014 1:14 am

:) exactly I say :
I want as developer use ids, urls, titles like this:
Code: Select all
umsp://plugins/name?url=http://url/?page=1&amp;level=logos
(with &amp; &lt; , &quot; etc.) one time and this work now on 1.02 1.05 and must work on new versions with UMSP2 and LAN

so into funcs-upnp.php just old
Code: Select all
$ndResult = $doc->createElement('Result',$prmDIDL);


without new:
Code: Select all
$encodedDIDL = _xmlentities($prmDIDL);
...
$ndResult = $doc->createElement('Result', $encodedDIDL);


And can you recommend some Android app to test UPNP/DLNA via WD UMSP_LAN?
WD TV Live (1.02.21-WDLXTV-0.4.7.3);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413; WMU219453404899; WMR161810775332
User avatar
DJArty
Developer
 
Posts: 540
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Mon Mar 31, 2014 1:29 am

I only tested UMSP_LAN with XBMC. There was a beta for android that worked as well (playback was done with an external player).
I will think about the encoding of parameters. I don't remember exactly why the decoding of the parameters before sending them to the plugin didn't work...
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby mehimu » Tue Aug 05, 2014 11:07 pm

thanks
mehimu
n00b
 
Posts: 7
Joined: Fri Aug 01, 2014 9:16 pm

https in $items['res']   

Postby avkiev » Sun Feb 22, 2015 3:35 pm

As I can see - $items['res'] supports only 2 schemes: http:// and file://
True ?
Is it possible to add support of "https://" ?
Any workaround ?
avkiev
Developer
 
Posts: 167
Joined: Tue Apr 27, 2010 5:02 am
Location: Ukraine, Kiev

Re: UMSP Plugin Development   

Postby mad_ady » Sun Feb 22, 2015 11:30 pm

As far as I know you can use https. The playback engine needs to be able to support it, and if there are no problems with certificates, there should be no issue. For example many of my plugins have folder images stored on picasa web and have https links for res.
User avatar
mad_ady
Developer
 
Posts: 4525
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 0 guests