Hi Dave,
I’ve been following this thread on and off for the last week or so and had some time today to play around with WebYep to see if anything could be done to get these files not to automatically download but play in the browser. I can think of a couple of ways to essentially hack some of the WebYep system files to do this but it isn’t going to be particularly pleasant. You’ve been warned.
If you look at the following page I’ve added four webyep attachment fields to the page;
http://www.freewayactions.com/test/cms/-webyep/
The first three contain mp3 files, two of which I’ve set to play in the browser using audiojs, and the final file is the hacked WYAttachmentElement.php file.
Here is how the system currently works;
- Add the standard webyep init code to your page before the doctype as usual
- Add the standard webyep_attachment codes to your page for each attached file
- For files that you don’t want to download but want to play in the browser (at the moment MP3s are the only supported file types) add the label ‘[ndl]’ into the field name.
For example the following field will try and play any mp3 files uploaded using this element;
<?php webyep_attachment("file1[ndl]", false); ?>
- Locate the file webyep-system > program > elements > WYAttachmentElement.php on your server and rename it to WYAttachmentElement-ORIGINAL.php
- Upload the hacked WYAttachmentElement.php file you downloaded from the example page above to this same location
- FTP the audiojs library to the server and add the required code in the of the HTML page. Check the source code of that example page.
Now if it has all gone well you should have the ability to upload mp3 files and have them play in the browser. Simply leave the [ndl] label off of the field name and the file will download as normal.
You should understand that this is a total hack at the moment. In an ideal world something like this should be offered as a seamless extension to WebYep rather than hacking around with core files. Sadly at the moment I don’t know how WebYep ticks internally to do anything other than patch these things together. There’s a learning opportunity here for me I guess!
When you’ve finished playing you should remove the file we uploaded in step 5, rename the file in step 4 back to WYAttachmentElement.php and remove the [ndl] labels in any of the attachment fields. Do this and you should be back to your regular WebYep install.
Regards,
Tim.
On 18 Jul 2012, at 14:58, TeamSDA wrote:
Seems unfortunate as this would unlock a lot of potential. Tried a direct rout to WebYep and all they said was . . .
“Unfortunately there is no configuration option to change this behavior”
FreewayActions.com - Freeware and commercial Actions for Freeway Express & Pro - http://www.freewayactions.com
FreewayStyle.com - Free Freeway templates and parts to download, use and explore - http://www.freewaystyle.com
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options