Sign up here and you can log into the forum!

my next crazy idea - trailers

General WDTVExt forum

Re: my next crazy idea - trailers   

Postby KAD » Fri Feb 10, 2012 6:07 pm

since this thread is mainly how to devlopment type questions, I guess I'll continue to ask here

I can't seem to get the trailers to play with the correct name
it's always "Title 1" or the last played item

here's an example of the meta from log
Code: Select all
Lib: [executeCmd]  cmd: upnp-cmd SetAVTransportURI "http://video-http.media-imdb.com/MV5BMTI5MzMxNTA1M15BMTFeQW1wNF5BbWU3MDI1NTkyMzM@.mp4?Expires=1328958174&Signature=fE83QchdhiSvj8CFkgPV6oq85CwpLd5R2I0XSjQNnkGGPbie9McZjZ4jJ1vEanR3wtggXWG5rF5aUrxCFPSj1EFvg3oh3ErLIkeM7CFc3b0A4avlu7s92hTJxhSCLTFQ68MO-qla8C8Ces-Uks~GcpVDfZq6x4PDRMOf2SGs8XU_&Key-Pair-Id=APKAILW5I44IHKUN2DYA&hint=flv" "<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/"><item id="http://video-http.media-imdb.com/MV5BMTI5MzMxNTA1M15BMTFeQW1wNF5BbWU3MDI1NTkyMzM@.mp4?Expires=1328958174&Signature=fE83QchdhiSvj8CFkgPV6oq85CwpLd5R2I0XSjQNnkGGPbie9McZjZ4jJ1vEanR3wtggXWG5rF5aUrxCFPSj1EFvg3oh3ErLIkeM7CFc3b0A4avlu7s92hTJxhSCLTFQ68MO-qla8C8Ces-Uks~GcpVDfZq6x4PDRMOf2SGs8XU_&Key-Pair-Id=APKAILW5I44IHKUN2DYA&hint=flv" parentID="http://video-http.media-imdb.com/MV5BMTI5MzMxNTA1M15BMTFeQW1wNF5BbWU3MDI1NTkyMzM@.mp4?Expires=1328958174&Signature=fE83QchdhiSvj8CFkgPV6oq85CwpLd5R2I0XSjQNnkGGPbie9McZjZ4jJ1vEanR3wtggXWG5rF5aUrxCFPSj1EFvg3oh3ErLIkeM7CFc3b0A4avlu7s92hTJxhSCLTFQ68MO-qla8C8Ces-Uks~GcpVDfZq6x4PDRMOf2SGs8XU_&Key-Pair-Id=APKAILW5I44IHKUN2DYA&hint=flv" restricted="0"><dc:title>2012</dc:title><dc:date></dc:date><upnp:class>object.item.imageItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo="file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000" protection="" tokenType="0" bitrate="0" duration="" size="" colorDepth="0" ifoFileURI="" resolution="">http://video-http.media-imdb.com/MV5BMTI5MzMxNTA1M15BMTFeQW1wNF5BbWU3MDI1NTkyMzM@.mp4?Expires=1328958174&Signature=fE83QchdhiSvj8CFkgPV6oq85CwpLd5R2I0XSjQNnkGGPbie9McZjZ4jJ1vEanR3wtggXWG5rF5aUrxCFPSj1EFvg3oh3ErLIkeM7CFc3b0A4avlu7s92hTJxhSCLTFQ68MO-qla8C8Ces-Uks~GcpVDfZq6x4PDRMOf2SGs8XU_&Key-Pair-Id=APKAILW5I44IHKUN2DYA&hint=flv</res></item></DIDL-Lite>"


As you can see it's very complete, and I don't get error messages, it just never displays the title that shows in the meta???

KAD
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4015
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby PaulF » Fri Feb 10, 2012 10:21 pm

A couple of guesses. The & is escaped in PHP because it is an xml key character. Does it need to be escaped in java script? EDIT: I see you use the upnp-cmd which escapes everything. I guess I am little help.

Shouldn't the upnp:class end in "video"?

I think you and I are the only ones in the pacific time zone(besides the absent b-rad). Everyone else is probably asleep,
User avatar
PaulF
Developer
 
Posts: 420
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: my next crazy idea - trailers   

Postby KAD » Fri Feb 10, 2012 10:49 pm

yeah, not too many of us on PST

the output in log above is as it's run

here's the line that is generating that meta
Code: Select all
   var meta = ("<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/\"><item id=\"" + Trailer + "\" parentID=\"" + Trailer + "\" restricted=\"0\"><dc:title>" + Title + "</dc:title><dc:date></dc:date><upnp:class>object.item.imageItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo=\"file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000\" protection=\"\" tokenType=\"0\" bitrate=\"0\" duration=\"\" size=\"\" colorDepth=\"0\" ifoFileURI=\"\" resolution=\"\">" + Trailer + "</res></item></DIDL-Lite>");


suppose I should have included this above to begin with

upnp:class, good idea I'll look into it, although, that was copied from valid meta generated on a local .m2ts file

KAD
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4015
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby mad_ady » Sat Feb 11, 2012 12:24 am

PaulF is right. The ampersands should be escaped to &amp;, otherwise the XML is invalid. You can do this with a regular expression on the video url similar to this
Code: Select all
Trailer.replace(/&/g, "&amp;");
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 11, 2012 1:06 pm

well it was certainly a good idea, but I'm getting the same result and running out of idea's

here's the new meta below
Code: Select all
Lib: [executeCmd]  cmd: upnp-cmd SetAVTransportURI "http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4?Expires=1329026447&Signature=3X5kAeZEHG~fxQKVajVh4-iBUGcIiM4-H7kUFLKJOVJwlmFxO8rNc4gntAgqld13QQeT9cA1uPgUmhbsYYdF81zn5mN2KZ8eil2CZJ8Xv3KBh2-PExeUnMnjksHc1KfmP7FiAyfsE3IzJ6AiJjgApJKhY13BaaQC~Wo~qbxZC9U_&Key-Pair-Id=APKAILW5I44IHKUN2DYA&hint=flv" "<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/"><item id="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4?Expires=1329026447&amp;Signature=3X5kAeZEHG~fxQKVajVh4-iBUGcIiM4-H7kUFLKJOVJwlmFxO8rNc4gntAgqld13QQeT9cA1uPgUmhbsYYdF81zn5mN2KZ8eil2CZJ8Xv3KBh2-PExeUnMnjksHc1KfmP7FiAyfsE3IzJ6AiJjgApJKhY13BaaQC~Wo~qbxZC9U_&amp;Key-Pair-Id=APKAILW5I44IHKUN2DYA&amp;hint=flv" parentID="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4?Expires=1329026447&amp;Signature=3X5kAeZEHG~fxQKVajVh4-iBUGcIiM4-H7kUFLKJOVJwlmFxO8rNc4gntAgqld13QQeT9cA1uPgUmhbsYYdF81zn5mN2KZ8eil2CZJ8Xv3KBh2-PExeUnMnjksHc1KfmP7FiAyfsE3IzJ6AiJjgApJKhY13BaaQC~Wo~qbxZC9U_&amp;Key-Pair-Id=APKAILW5I44IHKUN2DYA&amp;hint=flv" restricted="0"><dc:title>10,000 BC</dc:title><dc:date></dc:date><upnp:class>object.item.imageItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo="file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000" protection="" tokenType="0" bitrate="0" duration="" size="" colorDepth="0" ifoFileURI="" resolution="">http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4?Expires=1329026447&amp;Signature=3X5kAeZEHG~fxQKVajVh4-iBUGcIiM4-H7kUFLKJOVJwlmFxO8rNc4gntAgqld13QQeT9cA1uPgUmhbsYYdF81zn5mN2KZ8eil2CZJ8Xv3KBh2-PExeUnMnjksHc1KfmP7FiAyfsE3IzJ6AiJjgApJKhY13BaaQC~Wo~qbxZC9U_&amp;Key-Pair-Id=APKAILW5I44IHKUN2DYA&amp;hint=flv</res></item></DIDL-Lite>"



here's an example of valid meta
Code: Select all
upnp-meta /tmp/media/usb/Action/2012/2012.m2ts
<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/"><item id="3/tmp/media/usb/Action/2012/2012.m2ts" parentID="3/tmp/media/usb/Action/2012\/" restricted="0"><dc:title>2012.m2ts</dc:title><dc:date></dc:date><upnp:class>object.item.imageItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo="file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000" protection="" tokenType="0" bitrate="0" duration="" size="32822710272" colorDepth="0" ifoFileURI="" resolution="">file:///tmp/media/usb/Action/2012/2012.m2ts</res></item></DIDL-Lite>

If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4015
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby mad_ady » Sun Feb 12, 2012 1:05 am

You still have
Code: Select all
<upnp:class>object.item.imageItem</upnp:class>

Try to change it to
Code: Select all
<upnp:class>object.item.videoItem</upnp:class>
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: my next crazy idea - trailers   

Postby KAD » Sun Feb 12, 2012 1:40 am

tried videoItem it has the same results

so I attempted to run the cmd manually
Code: Select all
upnp-cmd SetAVTransportURI "http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" "<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/"><item id="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" parentID="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" restricted="0"><dc:title>10,000 BC</dc:title><dc:date></dc:date><upnp:class>object.item.videoItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo="file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000" protection="" tokenType="0" bitrate="0" duration="" size="" colorDepth="0" ifoFileURI="" resolution="">http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4</res></item></DIDL-Lite>"


which resulted in

Code: Select all
-sh: DLNA.ORG_CI=0: not found
-sh: DLNA.ORG_FLAGS=00000000001000000000000000000000 protection= tokenType=0 bitrate=0 duration= size= colorDepth=0 ifoFileURI= resolution=>http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4</res></item></DIDL-Lite>: not found


?? :?

KAD
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4015
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby mad_ady » Sun Feb 12, 2012 1:51 am

of course :) it was starring us in the eye. The problem is with quotes - you have unescaped double quotes in your XML. Either change those to single quotes or escape the double quotes.

The escape character is \ -> so " would become \" if you run from shell.
Within the javascript code you might need to add an extra escape level so that \" becomes \\\" :)
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: my next crazy idea - trailers   

Postby recliq » Sun Feb 12, 2012 3:11 am

and here's the simple solution...
Code: Select all
upnp-cmd SetAVTransportURI "http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" '<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/"><item id="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" parentID="http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4" restricted="0"><dc:title>10,000 BC</dc:title><dc:date></dc:date>upnp:class>object.item.videoItem</upnp:class><dc:creator></dc:creator><upnp:genre></upnp:genre><upnp:artist></upnp:artist><upnp:album></upnp:album><res protocolInfo="file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000" protection="" tokenType="0" bitrate="0" duration="" size="" colorDepth="0" ifoFileURI="" resolution="">http://video-http.media-imdb.com/MV5BMTQ5Nzc4MjM0NV5BMTFeQW1wNF5BbWU3MDUwMDkzMzM@.mp4</res></item></DIDL-Lite>'

which gives this in console log:
Code: Select all
mlp_event CODE_TRACK 113
0 :(1/0) 1
1 :(1/2) 0
3 :(1/5) 0
4 :(9/7) 10,000 BC
10 :(90/22) file-get:*:*::DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=00000000001000000000000000000000

The file does not play though but this is because it fails with a 403:
Code: Select all
HTTP/1.0 403 Forbidden


Only thing I changed was to enclose the meta string in single quotes (') instead of double quotes ("). Since you have double quotes in the meta string it didn't work.
SO you have to either quote the double quotes like mad_ady pointed out (which can get quite annoying if you pass the string more than once you have to quote it more than once...) or enclose the string with double quotes in single quotes.
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5024
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: my next crazy idea - trailers   

Postby mad_ady » Sun Feb 12, 2012 5:52 am

The 403 forbidden is probably because the link is already expired.
User avatar
mad_ady
Developer
 
Posts: 3002
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 1 guest