rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: raybob on April 02, 2011, 03:43:14 PM

Title: simple mp3 streaming
Post by: raybob on April 02, 2011, 03:43:14 PM
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>
Title: Re: easy mp3 streaming
Post by: SilentPliz on April 03, 2011, 02:27:26 AM
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]
Title: Re: simple mp3 streaming
Post by: SilentPliz on April 03, 2011, 04:48:55 PM
... {.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.
Title: Re: simple mp3 streaming
Post by: rejetto on April 06, 2011, 01:27:13 PM
thanks for sharing :)
Title: Re: simple mp3 streaming
Post by: apocalips on June 30, 2011, 03:46:29 PM
can anybody send me full script for mp3 streeming?
Title: Re: simple mp3 streaming
Post by: raybob on July 02, 2011, 08:13:26 PM
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>