This is a message.

Forum user: vashkenazy

Basic information

Registered Jun 1, 2009
Last login Jul 15, 2009
Forum posts 6
Direct URL http://www.flowplayer.org/forum/users/11231

Latest forum posts

Posts:

Registered:

» » » » Single quote - again!

Posted: Jun 17, 2009

Thanks for reply Paul. I need more help. Actually I found that there's no need to escape the minus sign. The & symbol can be solved with the escape sequence, but both plus and single quote no. Try to pass an mp3 named '.mp3 or +.mp3 to the array in jscript, and you'll see flowplayer won't play it.

Thanks

Andrea

Posts:

Registered:

» » Single quote - again!

Posted: Jun 17, 2009

Here is the page. I am trying to dinamically load a playlist with all mp3s contained in a specific folder, using the proper filesystem objects.
In detail, that page tries to read all mp3 files and builds a javascript array, then pass that object as playlist parameter to the flowplayer library.
But problem occurs when the filename contains special characters, like &,+,-,single quote,... and so on. For certain characters I solved with replace function (& transformed to &26), but it does not work for +,-, & and single quote
Is there a way to bypass this?

Just replace the word "quote" with the single quote symbol.
I'm forced to do this because single quote generate problems to forum as well...


<% @Page Language="VB" %>
<% @Import Namespace="System.Web.UI" %>
<% @Import Namespace="System.IO" %>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <script type="text/javascript" src="flowplayer-3.1.1.min.js"></script>
 <title>Flowplayer test</title>
</head>
<body>
 <div id="page">
  <h1>Flowplayer</h1>
  <div style="display:block;width:400px;height:80px" id="player"></div> 
  <script language="javascript">
      var mylist=new Array() ;
      var j=0;
      var temp=quotequote;
  </script>
  <% Dim di As DirectoryInfo = New DirectoryInfo("m:7")
            Dim CodedURL as string
            For Each fi As FileInfo In di.GetFiles()
                 If fi.Extension=".mp3" Then
                 CodedURL=replace(fi.name,"'","quote")
%>
        <script language="javascript">
            temp=(quotehttp://sirio:81/stream/7/<%=CodedURL%>quote).replace(/&/g, quote%26quote);
            temp=temp.replace(/+/g,quote%2Bquote);
            temp=temp.replace(/-/g,quote%3Aquote);
            mylist[j]=temp;
            document.write(temp +quote<br>quote);
            j++;
        </script>
<%                End If
            Next
   %>
  
  <script language="javascript">  
   flowplayer("player", "./flowplayer-3.1.1.swf",
   {playlist: mylist,
       plugins:  { 
           controls: {fullscreen: false, url: 'flowplayer.controls-3.1.1.swf',playlist: true, backgroundColor: '#aedaff',
               tooltips: {buttons: true}
           },
                    audio: {url: 'flowplayer.audio-3.1.0.swf'}
                }
            });
  </script>
 </div>
</body>
</html>

Posts:

Registered:

Single quote - again!

Posted: Jun 4, 2009

Hello all.

I noticed trying to pass file names with SINGLE QUOTE to flowplayer playlist dosn't work. It actually breaks playlist object.
I tried with escape chacter and with "%2B" sequence, but no luck.

Any help appreciated.

Thanks.