rejetto forum
May 25, 2012, 11:50:37 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: simple mp3 streaming  (Read 1391 times)
0 Members and 2 Guests are viewing this topic.
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« on: April 02, 2011, 10:43:14 AM »

Just add this to your template.

Code:
[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|
{.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>
.}



{.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, 09:50:27 AM by raybob95 » Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #1 on: April 02, 2011, 09:27:26 PM »

Hi raybob95! Wink

You can further simplify the code. Smiley

Code:
[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>.}:} .}
{.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>
.}

{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}[/color]
« Last Edit: April 02, 2011, 09:30:19 PM by SilentPliz » Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #2 on: April 03, 2011, 11:48:55 AM »

... {.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, 12:00:32 PM by SilentPliz » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #3 on: April 06, 2011, 08:27:13 AM »

thanks for sharing Smiley
Logged
apocalips
Occasional poster
*
Offline Offline

Georgia Georgia

Posts: 1


View Profile
« Reply #4 on: June 30, 2011, 10:46:29 AM »

can anybody send me full script for mp3 streeming?
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #5 on: July 02, 2011, 03: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>
Logged
rejetto forum
« Reply #5 on: July 02, 2011, 03:13:26 PM »

Do you like this software? Consider even $2
 Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 24, 2012, 12:35:35 AM