Page 1 of 1

Script to execute file

Posted: Fri Jun 03, 2011 8:13 pm
by marko3d
Hi,
Does anybody know how to make a script that will execute some .exe file every time some movie is played via wild media server ?

Thank you,
Marko

Re: Script to execute file

Posted: Sun Jun 05, 2011 5:45 am
by Eugene
Hi,

If playback does not matter, you can add a transcoding profile, which will call a exe-file as a transcoder or use the system ole-objects. Set a transcoding profile for some movie.

Re: Script to execute file

Posted: Sun Jun 05, 2011 8:23 am
by marko3d
What I would like to accomplish is to call an exe file on some "important" events.

For example, I have log file somewhere on the network, and I have report.exe which connects to my server and reports an status.
report.exe accepts parameter for example
When movie1 is played to call report.exe "Movie1 playing"
When movie1 is stopped to call report.exe "Movie1 stopped"

this can also be accomplished by calling to an URL instead exe file
For example:
When movie1 is played to call http://www.myserver.com/report.php?text=Movie1 playing
When movie1 is stopped to call http://www.myserver.com/report.php?text=Movie1 stopped

Is it possible to accomplish in Wild media server ? :)
Thank you,
Marko

Re: Script to execute file

Posted: Sun Jun 05, 2011 10:56 am
by Eugene
marko3d wrote:What I would like to accomplish is to call an exe file on some "important" events.

For example, I have log file somewhere on the network, and I have report.exe which connects to my server and reports an status.
report.exe accepts parameter for example
When movie1 is played to call report.exe "Movie1 playing"
When movie1 is stopped to call report.exe "Movie1 stopped"

this can also be accomplished by calling to an URL instead exe file
For example:
When movie1 is played to call http://www.myserver.com/report.php?text=Movie1 playing
When movie1 is stopped to call http://www.myserver.com/report.php?text=Movie1 stopped

Is it possible to accomplish in Wild media server ? :)
Thank you,
Marko
In this case, no concepts start-stop. In fact it is http-server, the device may request content from any position and portions. Request content from position 0 - event "After the beginning of a playback" of a media resource", transfer the last byte of the media resource - event "After the end of a playback of a media-resource" (Settings - Additional - Events). You can use the system ole-objects for http-requests in the events "After the beginning of a playback" of a media resource", "After the end of a playback of a media-resource"

Re: Script to execute file

Posted: Sun Jun 05, 2011 5:48 pm
by marko3d
Thank you Eugene,
Could you please give me an example of such script ?
I'm not good at programming so I don't know how to accomplish that.

Thank you very much

Re: Script to execute file

Posted: Mon Jun 06, 2011 6:17 am
by Eugene
Settings - Processing - Add - Name: Start playback
Script:

Code: Select all

begin
  //WmsLogMessage(mtiInfo, 'http://www.myserver.com/report.php?text=' + WmsHttpEncode(CurrentMediaItem.Properties[mpiTitle] + ' playing'))
  WmsDownloadUrl('http://www.myserver.com/report.php?text=' + WmsHttpEncode(CurrentMediaItem.Properties[mpiTitle] + ' playing'))
end.
Ok - Add - Name: End playback
Script:

Code: Select all

begin
  //WmsLogMessage(mtiInfo, 'http://www.myserver.com/report.php?text=' + WmsHttpEncode(CurrentMediaItem.Properties[mpiTitle] + ' stopped'))
  WmsDownloadUrl('http://www.myserver.com/report.php?text=' + WmsHttpEncode(CurrentMediaItem.Properties[mpiTitle] + ' stopped'))
end.
Ok - Ok
Additonal - Events - "After the beginning of a playback..." - "Start playback" - "After the end of a playback..." - "End playback" - OK

Re: Script to execute file

Posted: Sat Oct 08, 2011 4:11 pm
by marko3d
It's been a while.
This solution you provided worked very good.. but now I'm thinking of a different approach and I would love to call an exe file with some parameter when playback is started or ended.
It should be the same way as this url calling but is there some procedure instead WmsDownloadUrl that will call program ? .. something like WmsExecute("program.exe start");
and when stopped WmsExecute("program.exe stop");
Is there some function that will accomplish that ? ..
Thank you,
Marko

Re: Script to execute file

Posted: Sat Oct 08, 2011 4:38 pm
by Eugene