Results 1 to 3 of 3

Thread: Problem using a Flash Audio Player with News file enclosures

  1. #1
    New user
    Join Date
    07-08-09.
    Posts
    15

    Default Problem using a Flash Audio Player with News file enclosures

    I'm trying to set up a flash player to use with news items that have audio file enclosures on them. Up until this point, it has been working fine, but something must have changed with the most recent update of TYPOlight.

    Here's the code I'm using in the template to output my player:
    Code:
    <?php if ($this->enclosure): ?>
       <div class="enclosure">
             <?php foreach ($this->enclosure as $enclosure): ?>
                   <div>
    
                      <span id="audioplayer_1">You must have flash installed to play audio files within your browser.</span>  
                         <script type="text/javascript">  
                         AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo $enclosure['href']; ?>"});  
                         </script>  
    
                   </div>
             <?php endforeach; ?>
       </div>
    <?php endif; ?>
    This should work, but I think the problem is the output of this line:
    Code:
    <?php echo $enclosure['href']; ?>
    Because it outputs this text:
    posts/items/postTitle.html?file=tl_files/audiofiles/2010/song.mp3
    Basically, I only want what comes after "posts/items/postTitle.html?file=" but I can't get it to output that.

    I've tried this line:
    Code:
    <?php echo $enclosure['link']; ?>
    But it outputs the file name itself ("song.mp3"). And since we are uploading the audio files into yearly folders, I can't just manually type in the folder path.

    Is there another tag I could use that would output the file's actual location on the server? Like this: "tl_files/audiofiles/2010/song.mp3"

    Please help! Until I get this figured out, my client's blog is really messed up!

  2. #2
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: Problem using a Flash Audio Player with News file enclos

    Here is a quick workaround to get the blog up and running again:

    Code:
    <?php echo str_replace('posts/items/postTitle.html?file=', '', $enclosure['href']); ?>

  3. #3
    New user
    Join Date
    07-08-09.
    Posts
    15

    Default Re: Problem using a Flash Audio Player with News file enclos

    Thanks Leo. I submitted a feature request on the project site as well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •