This is a message.

Flowplayer playing files with multiple URL params? Created Feb 24, 2009

This thread is solved

Views: 7577     Replies: 8     Last reply Aug 8, 2011  
You must login first before you can use this feature

Nilo

Posts: 9

Registered:
Nov 25, 2008

Flowplayer playing files with multiple URL params?

Posted: Feb 24, 2009

When putting a link in the playlist I find that flowplayer will not download a link that has two vars as part of the URL example:

/Download?var1=23 flowplayer will bring up the file
/Download?var1=39&var2=33 flowplayer will NOT play the file
/Download?var1=23&var2=23&var3=45 flowplayer will NOT play the file
Is it something to do with the & or something else?

Even though both URLs download the same file in a browser, is this a known issue, or do I need to do something else?

Nilo

Posts: 9

Registered:
Nov 25, 2008

flowplayer-3.0.0-rc4

Posted: Feb 24, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
flowplayer-3.0.0-rc4

Nilo

Posts: 9

Registered:
Nov 25, 2008

Debugging

Posted: Feb 24, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
So when I take out the & in the URL as in /Download?var1=32var2=32 it works fine obviously I don't get the values of var1 and var2 in my code but the flowplayer works. When the '&' is added back into the URL it doesn't work. After installing Adobe's debugger i get the following message pop to my screen:

Error: Unterminated string literal
at com.adobe.serialization.json::JSONTokenizer/parseError()
at com.adobe.serialization.json::JSONTokenizer/readString()
at com.adobe.serialization.json::JSONTokenizer/getNextToken()
at com.adobe.serialization.json::JSONDecoder/nextToken()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseArray()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder/parseObject()
at com.adobe.serialization.json::JSONDecoder/parseValue()
at com.adobe.serialization.json::JSONDecoder()
at com.adobe.serialization.json::JSON$/decode()
at org.flowplayer.config::ConfigLoader$http://flowplayer.org/core/internal::parseConfig()
at org.flowplayer.view::Launcher/createFlashVarsConfig()
at org.flowplayer.view::Launcher/initPhase1()
at flash.display::DisplayObjectContainer/addChild()
at org.flowplayer.view::Preloader/init()

Why the parser is all the way down in the playlist seems odd but here is my config:

<script>
  $(window).load(function() {
    $("#pl").scrollable();
    var api = $("#pl").scrollable();
    $("a.prevPage").click(function() { api.prevPage(500); });
    $("a.nextPage").click(function() { api.nextPage(500); });
    $f("player", "/flowplayer-3.0.0-rc4.swf", {
      clip: {
        autoPlay: false,
        autoBuffering: true,
        scaling: 'fit'
      },
      plugins: {
        controls: {
          url: '/flowplayer.controls-3.0.0-beta7.swf',
          timeColor:         '#ffb301',
          progressColor:     '#7a5c01',
          bufferColor:       '#fff4d6',
          buttonColor:       '#a49f88',
          buttonOverColor:   '#bdb292',
          sliderColor:       '#000000',
          durationColor:     '#ffffff',
          progressGradient:   'medium',
          bufferGradient:       'none',
          sliderGradient:       'none'
        }
      },
      canvas: {
        backgroundColor: '#000000',
        backgroundGradient: 'none'
      }
    }).playlist("div.entries",{loop:true});
  });
</script>

<a id="player" name="player" href="/DownloadMedia?key1=12&key2=13" class="player"></a>
  <div id="pl" style="display: none">
    <a class="prevPage"></a>
    <div class="entries">
      <a href="/DownloadMedia?key1=12&key2=13">Media 1<em>00:03:31</em></a>
    </div>
    <a class="nextPage"></a>
</div>

Nilo

Posts: 9

Registered:
Nov 25, 2008

player 3.0.5 and controls 3.0.3

Posted: Feb 24, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
Just read the post "clip url escape problem" seemed to be the same problem the fix was to use beta5. I just downloaded:

flowplayer-3.0.5.swf
flowplayer.controls-3.0.3.swf

Didn't work still get the same problem.

Nilo

Posts: 9

Registered:
Nov 25, 2008

Work Around Found

Posted: Feb 24, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
So after reading the "clip url escape problem" a little closer it appears that instead of using & in the URL you have to use a %26. This seems to make it work. So the following URL:

/Download?var1=23&var2=23&var3=45

needs to be changed to:

/Download?var1=23%26var2=23%26var3=45

Then the video will play correctly and your var1, var2 and var3 will be passed in correctly.

Will there be a fix for this in the long term or is this the fix for this?

Anssi
Flowplayer Flash & video streaming developer

Posts: 1197

Registered:
Jul 24, 2007

» Work Around Found

Posted: Feb 24, 2009

Reply to: Work Around Found, from nilo
You can always use the escape() JS function to escape the urls. For example


playlist: [
  escape("/Download?var1=23&var2=23&var3=45")
]

I think this is the long-term fix.

Nilo

Posts: 9

Registered:
Nov 25, 2008

Some what of a work around found.

Posted: Feb 24, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
Well I have noticed that the playlist does not work when you put the %26 in the list. Plus I am doing the html list. So for the URL that is for the player example:


<a id="player" name="player" href="/DownloadMedia?key1=12%26key2=13" class="player"></a>

You MUST use %26, but for the &, in the playlist example:


    <div class="entries"> 
      <a href="/DownloadMedia?key1=12&key2=13">Media 1<em>00:03:31</em></a> 
    </div> 

You MUST use & in between the vars. Also after talking to one of my coworkers he said that on a previous project when going to URL's with flash you have to put %26 rather then &.

I don't think this is an issue with flowplayer I think it has to do more with how the flash client connects to other URL's.

Now to test this whole theory on IE 6, 7, 8, Firefox 1.5, 2, 3, Safari, and see if it holds true.

bannerweb

Posts: 2

Registered:
Jun 23, 2008

What about 2.2.4?

Posted: May 25, 2009

Reply to: Flowplayer playing files with multiple URL params?, from nilo
Is there any way to accomplish this in flowplayer 2.2.4?