Sign up here and you can log into the forum!

3/15/2013 Plugin: Random Music Player 1.1

The WDTVExt plugin depot. Plugins/libraries/code only

Re: 1/29/2013 Plugin: Random Music Player 1.0   

Postby KAD » Fri Mar 15, 2013 10:20 am

is it normal for the audio file to open as a video file?


I decided to take a look at /usr/bin/upnp-meta

it appears the codec info generated in the meta is
either
*
or an image codec

so it seems the wd just assumes a video file if no info is provided

I'll need to test, but it seems reasonable, if we provided audio codec info in the upnp-meta
that WD would then use the music player to initiate playback, instead of the video player
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: 1/29/2013 Plugin: Random Music Player 1.0   

Postby mad_ady » Fri Mar 15, 2013 11:57 am

Well, it's about time you learned how to use it. It may prove useful in the future.

Try this for size: http://tovid.wikia.com/wiki/SVN_crash_course

The basics steps are:
1. You check out the source tree in a new directory on your hdd
2. You add/change code
3. If you added new files that were not part of the original code you will need to do "svn add dir-name"
4. When you are ready to commit your changes, do a svn diff to see what would get changed
5. To commit something do svn commit -m "my comment goes here"
6. Profit.

You can commit part of the code if you run the svn commit in a subdirectory of the tree you checked out.
User avatar
mad_ady
Developer
 
Posts: 4544
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: 1/29/2013 Plugin: Random Music Player 1.0   

Postby KAD » Fri Mar 15, 2013 12:00 pm

ok, will take a look
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: 1/29/2013 Plugin: Random Music Player 1.0   

Postby sonic_blue » Fri Mar 15, 2013 5:45 pm

I'm finding that after approximately 20 songs the OSD crashes and doesn't respond to any remote commands. Music still continues to play on shuffle, and RandomMusicPlayerLoop.log reports that it is still running fine, but dmaosd.log is saying it's crashed on some error.

I searched the forum and found a comment where you said that if you initiate a Play command while something is already playing back, that it will crash the OSD. So, maybe that is happening, I don't really know.

I am interested to try and play the files as audio using unpnp-cmd meta to see if that helps.
sonic_blue
DLX'er
 
Posts: 53
Joined: Wed Feb 20, 2013 8:31 am

Re: 1/29/2013 Plugin: Random Music Player 1.0   

Postby sonic_blue » Fri Mar 15, 2013 6:46 pm

KAD wrote:
is it normal for the audio file to open as a video file?


I decided to take a look at /usr/bin/upnp-meta

it appears the codec info generated in the meta is
either
*
or an image codec

so it seems the wd just assumes a video file if no info is provided

I'll need to test, but it seems reasonable, if we provided audio codec info in the upnp-meta
that WD would then use the music player to initiate playback, instead of the video player


It works! I just added to /usr/bin/upnp-meta:

Code: Select all
if [ `echo "$fileName" | grep -q -i '\.mp3$'; echo $?` -eq 0 ]; then codec="audio/mp3"; fi
if [ `echo "$fileName" | grep -q -i '\.wma$'; echo $?` -eq 0 ]; then codec="audio/wma"; fi
if [ `echo "$fileName" | grep -q -i '\.mpa$'; echo $?` -eq 0 ]; then codec="audio/mpa"; fi
if [ `echo "$fileName" | grep -q -i '\.m4a$'; echo $?` -eq 0 ]; then codec="audio/m4a"; fi
if [ `echo "$fileName" | grep -q -i '\.mp4a$'; echo $?` -eq 0 ]; then codec="audio/mp4a"; fi
if [ `echo "$fileName" | grep -q -i '\.ogg$'; echo $?` -eq 0 ]; then codec="audio/ogg"; fi
if [ `echo "$fileName" | grep -q -i '\.wav$'; echo $?` -eq 0 ]; then codec="audio/wav"; fi
if [ `echo "$fileName" | grep -q -i '\.aac$'; echo $?` -eq 0 ]; then codec="audio/aac"; fi
if [ `echo "$fileName" | grep -q -i '\.flac$'; echo $?` -eq 0 ]; then codec="audio/flac"; fi
if [ `echo "$fileName" | grep -q -i '\.aif$'; echo $?` -eq 0 ]; then codec="audio/aiff"; fi
if [ `echo "$fileName" | grep -q -i '\.aiff$'; echo $?` -eq 0 ]; then codec="audio/aiff"; fi
if [ `echo "$fileName" | grep -q -i '\.mka$'; echo $?` -eq 0 ]; then codec="audio/mka"; fi



Need to write some lines to get Pause, FFWD, REW to work. And metadata to the Audio playback screen.
Last edited by sonic_blue on Fri Mar 15, 2013 7:42 pm, edited 2 times in total.
sonic_blue
DLX'er
 
Posts: 53
Joined: Wed Feb 20, 2013 8:31 am

Re: 3/15/2013 Plugin: Random Music Player 1.1   

Postby KAD » Fri Mar 15, 2013 7:28 pm

bump ver 1.1

@sonic_blue
looks like we're testing this at the same time

update has working stop button for audio_ex_playing.xml
also moved the log file to the root of the plugin path
maybe dmaosd is running out of memory that log file I'd guess could get pretty large
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: 3/15/2013 Plugin: Random Music Player 1.1   

Postby sonic_blue » Fri Mar 15, 2013 7:49 pm

Is there a list of all the xml files which correspond to which page you are on at the OSD?

eg. villa_home.xml I presume refers to the main menu.
sonic_blue
DLX'er
 
Posts: 53
Joined: Wed Feb 20, 2013 8:31 am

Re: 3/15/2013 Plugin: Random Music Player 1.1   

Postby KAD » Fri Mar 15, 2013 7:53 pm

nope, there's no list

but here's how I always find the xml
tail -f /tmp/dmaosd.log

then start navigating the osd
anytime you leave an xml it will log
..................audio_ex_playing.xml is popped

whatever xml is popped that corresponds to the screen you just exit
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: 3/15/2013 Plugin: Random Music Player 1.1   

Postby sonic_blue » Fri Mar 15, 2013 9:46 pm

I would like to add a unpnp-cmd Pause command inside the .js file, however I'm unsure how to do it.

Would this be correct, and if so, what is the correct key value for Pause.

Code: Select all
if ((page.markupFileName === "audio_ex_playing.xml") && (this.RandomMusicPlayer === true || this.RandomVideoPlayer === true)) {
      if (key == pause) {
         res = executeCmd("upnp-cmd Pause", this.debug.Lib);
}
sonic_blue
DLX'er
 
Posts: 53
Joined: Wed Feb 20, 2013 8:31 am

Re: 3/15/2013 Plugin: Random Music Player 1.1   

Postby sonic_blue » Fri Mar 15, 2013 10:16 pm

Trying to get FFWD and REW working like so:

Code: Select all
#upnp-cmd seek REL_TIME 00:01:33
[faultcode] => s:Client
[faultstring] => UPnPError
[detail] => 402Illegal value


Any idea what's wrong with this? Seems like I've given it the correct seek value. Tried it with " and ' as well.

edit: seems the parameter names are wrong.
sonic_blue
DLX'er
 
Posts: 53
Joined: Wed Feb 20, 2013 8:31 am

PreviousNext

Return to WDTVExt plugins

Who is online

Users browsing this forum: No registered users and 1 guest