Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Splitting files url - static & dynamic!!!

16 replies [Last post]

Hello all,

Please help me in this one: I would like to know if it is possible to set the value of 'streamer' (in Player.as) as static (http://www.domain.com/folder/) while making 'file' value dynamic loading from flashvars in the html code!?

I don't know if it's correct already, maybe I should only play with 'streamer' value with somekind of url splitting !?

Bottom line: can I set a default folder (in Player.as) to load different files from it with flashvars (in html)?
(Maybe you have any other method to achieve that?)

Im desperate :(

Thanks a lot!

@Wonderer

Yes, you sure can. In fact you can include another predefined flashvar (token) as well if you are using the secure token feature in you FMS config.

In your html that creates the player this line of code says "here's your file" to the player. <strong> var theFile = swfobject.getQueryParamValue('id');</strong>That file can be a playlist or a single file, Here's a playlist example.<strong>http://jim.playourvideo.net/musicdemo.htm?id=musicdemo.xml</strong>Here's a generic player that accepts individual files.<strong>http://jim.playourvideo.net/jv.htm?id=1.flv</strong>Just poke around in the source code of these example html pages and I think you'll see it's very straight forward.

Regards - JImb

Thank you very much Jimb for your quick response.
What Im trying to do is simply hide the domain where the video's folder is, in a way I put the ''http://www.mydomain.com/videos_folder/" inside the Player.as, and in the html I put only the filenames:
<param name="flashvars" value="file=my_video1.mp4&image=preview.jpg" />

As simple as that without using any encryption whatsoever or any playlist; filenames must be within flashvars and the domain+folder within Player.as (or Player.fla at last resort)

I succeeded with an xml based player with AS2, but I failed here (MediaPlayer-4.5) since Im new with AS3.
Im pretty sure the key is in 'streamer' or 'file' values wihtin player.as, but how to embed that url?!

It is impossible to have the video url half hardencoded (player.as) half dynamic (flashvars)?

Please!

Sorry. I misread your post yesterday. I thought you were using an RTMP Server. Apparently all you really want to do is hide the domain/folder in the player and then have it catch the file name and concatinate the two together to point to your file. You can't use the streamer flashvar as that is referenced elsewhere for it's intended purpose. You'd need to add a new flashvar to the player.as

Yes it could be done easily by modifying the player.as source code and recompiling. In truth you should know that while it can be done it really isn't going to give you much security. It will still be very simple to find the information.

Regards - Jimb

Exactly, it seems simpler using your words, at least to understand :)
Some code would be very much appreciated.

For the security matter I have no problem since most people won't use swf decompilers or stream sniffers

Thanks man!

Anybody? :(

Please!

Any expert?

Anybody?

please again!

Not even one?

Any hope?

It is that difficult to solve!? Please!

@Wonderer

Sorry I hadn't come back to this post as I hoped I'd given you an answer earlier. No, it's definately not hard. In your player code (assumes you use swfobject.js version 2.2) you need to add the highlighted line

<script type="text/javascript">
var player = null;
<strong> var theFile = swfobject.getQueryParamValue('id');</strong>

     var flashvars =
      {
        'autostart':            'true',
        'id':                   'playerId',
        'file':                  theFile
      };

      var params =
      {
        allowscriptaccess:    'sameDomain',
        allowfullscreen:      'true',       
        bgcolor:              '#BDC2CC'
      };
     
      var attributes =
      {
        id:                   'playerId',
        name:                 'playerId'
      };

swfobject.embedSWF('player.swf', 'player', '720', '530', '9.0.115', false, flashvars, params, attributes);
</script>

Then follow the instructions in this tutorial to modify the player.<strong>http://jim.playourvideo.net/lsvideo.htm?id=flashvars.mp4</strong>

Then when you post a link to your page you add something like this<strong>?id=the name of your file.mp4</strong>at the end of the URL. You "hardcode" the STATIC part in the STREAMER FLASHVAR in the Player.as file and the dynamic part is "the name of your file" part of the URL

Regards - Jimb

OMG I don't believe I got an answer :D

A HUUUUUGE Thanks man!

Im using Mediaplayer 4.5 with SWFObject v2.1, would it work?
Also, Im not using rtmp, just calling file's direct url.

just download the last version of the swfobject file wich is v2.2 and use it instead, it's free

I like the technique, but would it still be possible to get Youtube videos working?