codeforbtv / StreamOnly

A custom plugin for Omeka that allows the visitor to listen to protected audio files, but prevents the most common methods of downloading these files. It also limits the number of listeners simultaneously accessing protected audio files.
GNU General Public License v3.0
0 stars 0 forks source link

Allow site administrator to configure preload attribute for files of mimetype audio/mpeg #48

Open kunikla opened 6 years ago

kunikla commented 6 years ago

Firefox hangs the server's PHP engine when requesting preload of the 7th protected audio file. For sites with Items that have more than 6 protected audio files, and whose themes display all protected files on the Item's page, it will be necessary to set preload="none".

kunikla commented 6 years ago

The problem is that when pre-loading an audio file, the browser keeps the connection open with the server. Each browser places a limit on the number of open connections. The default for Firefox is 6, although the limit is configurable by the user. IE and other browsers set a limit of 2, and configuration is possible, but not simple. Allowing multiple connections to remain open to the server becomes a performance issue when there are many users.

While setting preload="none" keeps the browser from hanging in the browser/platforms tested, since the attribute is only a suggestion for the browser, it cannot be a guaranteed solution across all browsers/platforms.

The solution chosen is to place a restriction on themes used with this plugin. They can only output one <audio> element for a protected file per page. The theme used by the VMA website, BigPicture, has been modified to display a form that allows the user to select which audio file is to be accessed.

The documentation still needs to be updated.