TPlugin Issues

by Erick Engelke
September 8, 2024

TPlugin documentation says it is useful for displaying or playing through browser plugins, such as PDF, MP3 and other formats.

At the time the spec was written, these were often external programs to the user Web Browsers.

TPlugin works to this day on IE, Chrome based browsers (including Edge), Firefox and many others.

Sounds and Video

To play a sound, for example, you just set the TPlugin’s URL value to the MP3 source file, and it plays as long as the control is set to visible. If you don’t want the display, set ShowControls false;

The browser also displays a visual control bar for controlling the position and playback of the MP3 or Video. If you only want sound, you can set it to a 1x1 pixel box or behind another control and then it will barely be visible or fully hidden.

PDFs

Again, set the visible property to true, and set the URL to the desired file.

Problem/Workaround with Apple Brand Browsers

Safari browsers on Macs and iOS devices have a problem with TPlugin even though Chrome and FireFox at least on Macs work fine. I haven’t tested them on iOS.

So you need a workaround for multimedia and PDF files.

The solution for audio is to use a TAudio, it’s compatible with all known browsers. It has some useful features like Loop control, volume control, ShowControls, etc.

Another solution for Apple compatibility is that you must use TBrowser to accomplish the same thing, setting the URL to the filename.

This is not ideal, the IDIV used by TBrowser can be used for compromises, and playback may be delayed until the user presses the Play symbol.