rejetto forum

simple mp3 streaming

raybob · 6 · 2813

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
    • Posts: 453
    • View Profile
    • FileSplat.com
Just add this to your template.

Code: [Select]
[file=folder=link|private]

<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
        <input type='checkbox' class='selector' name='selection' value='%item-url%' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.get|is new.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
[color=blue]{.if|
{.or|
{.count substring|.mp3|{.lower|%item-name%.}.}|
{.count substring|.wav|{.lower|%item-name%.}.}|
{.count substring|.mid|{.lower|%item-name%.}.}|
{.count substring|.m4a|{.lower|%item-name%.}.}|
{.count substring|.wma|{.lower|%item-name%.}.}|
.}|
<div style="float:right" >
<button style="background-color:white; border:1px solid; height:24px; font-size:12px; padding-bottom:2px; width:72px;"  onclick="this.parentNode.innerHTML = '<object height=\'24\' > <embed src=\'%item-url%\' autostart=\'true\' loop=\'false\' height=\'24\' > </object>'">
<img style="height:12px;" src="/~img51" /> Stream</button>
</div>
.}[/color]


{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}
{.if| {.?search.} |{:{.123 if 2|<br /><div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
</td>
« Last Edit: April 03, 2011, 02:50:27 PM by raybob95 »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1297
  • ....... chut ! shh!
    • View Profile
Hi raybob95! ;)

You can further simplify the code. :)

Code: [Select]
[file=folder=link|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
        <input type='checkbox' class='selector' name='selection' value='%item-url%' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.get|is new.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
{.if| {.?search.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
[color=blue]{.switch|%item-ext%|,|mp3,wav,mid,m4z,wma|
<div>
<button style="background-color:white; height:20px; font-size:10px; padding-bottom:2px; width:45px" onclick="this.parentNode.innerHTML = '<object height=\'24\' > <embed src=\'%item-url%\' autostart=\'true\' loop=\'false\' height=\'24\' ></object>'">Play</button>
</div>
.}[/color]
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}[/color]
« Last Edit: April 03, 2011, 02:30:19 AM by SilentPliz »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1297
  • ....... chut ! shh!
    • View Profile
... {.count substring|...  is a bad solution in this context.

e.g:

{.count substring|.mp3|my_playlist.mp3.m3u.} return true here, while it's not an mp3 file.
« Last Edit: April 03, 2011, 05:00:32 PM by SilentPliz »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile

Offline apocalips

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
can anybody send me full script for mp3 streeming?


Offline raybob

  • Tireless poster
  • ****
    • Posts: 453
    • View Profile
    • FileSplat.com
What I posted above is all you need.

Alternatively, you can use this from Yahoo:

   <script type="text/javascript" src="http://webplayer.yahooapis.com/player.js"></script>