Menu

#264 Exernal Presentation Issue

Windows
open
nobody
None
1
2021-01-26
2021-01-18
Anonymous
No

We have been using OpenSong for several years. With the new 3.4.1 Beta version, we are having issues playing music files. For prior versions that we have used, you would chose the music file (.wma, .mp3, etc) as the external presentation. When we reached that point in the presentation, the default music player would open and play the file. It is no longer doing this. The external presentation is taking no action.

Discussion

  • Vwout

    Vwout - 2021-01-18

    That was accidental behavior. You might be able to reproduce that by prefixing the path to the media file with 'start ' (so a space between start and the music file). The windows command start may launch the default player for the music file.

     
    • Ed Palmer

      Ed Palmer - 2021-01-19

      I can verify the change in behavior. It was introduced with revision 1354 of PresentWindow in the trunk, which was merged into the branch that built 3.4.1.

      Let me look into this and see what might be possible to restore similar behavior to the previous versions.

       
  • SvA

    SvA - 2021-01-26

    I made the change so the "Wait for external application to finish before continue" option and the "Stop any currently running launched application" slide type will work on Windows. Operating systems other than windows remain unchanged. (I don't know if these functionalities work on those systems.)
    Unfortunately I could not find any way to keep being able to launch documents (your sound file is a "document" in this regard) and fix these options.

    Two suggestions:

    • specify your player in the "Path to application executable" field and pass the sound file in the Application parameters field, along with more command line options, if so needed.
    • use a launcher app to start up your sound file. This might or might not break the "Wait for external application to finish before continue" option but almost certainly will break the ability to terminate the player by moving to a different slide when the "Wait for external application to finish before continue" option is active or using a "Stop any currently running launched application" external slide. Apps you could use for the purpose
      • ShelExec](http://www.naughter.com/shelexec.html) by PJ Naughter (Free and open source)
      • if you want to use start, you will have to use it through cmd.exe, as Microsoft unfortunately ditched the separate executable and made it an internal command to cmd.exe
      • you could use shellexecute with any scripting language of your choice, for instance .vbs or .js with windows wscript scripting host.

    I will consider adding an option to use the framework's own launching mechanism, which was used before and still is on the other operation systems. Maybe, some day, XoJo fixes it and makes it work for Windows.

    Or maybe someone else happens to know how to use something equivalent to shellexecute and obtain the PID of the created process ...

     

    Last edit: SvA 2021-01-26
    • Ed Palmer

      Ed Palmer - 2021-01-26

      ShellExecuteExW will return a handle to the process in the SHELLEXECUTEINFOW structure and that can be converted to a Process ID with GetProcessID.

      There's a slight issue with this approach since the documentation for ShellExecuteExW indicates that hProcess can be zero even after a successful call if the program is already open. The example it uses is opening a HTML file with the default web browser already open.

      On my branch I have modified Win32Process to call ShellExecuteExW with the "open" verb if the filename does not end in a valid program extension (defined as ".exe" and ".com"). The hProcess, PID, and hThread are moved out of the PROCESSINFOW structure to separate instance variables. In limited testing, I have successfully launched and terminated an MP3 file with the default player in addition to running a .EXE file.

      This is not a perfect solution, but it is closer to the previous behavior using Shell.

      I have not tested the other operating systems. I think it is unlikely that Shell on macOS or Linux will launch the default program for a file.

       
  • Ed Palmer

    Ed Palmer - 2021-01-26

    V3.4.2 has been released to incorporate the ShellExecuteEx fix. Data files should launch properly with the default program. Please reply here if it does not.

    For others reading this thread, V3.4.2 is for Windows only. Linux and macOS users should continue to use V3.4.1. You are not missing out on anything. 🤓

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB