Stretching (uniform,fill,exactfit,bestfit,none)

This thread may refer to an older version of JW Player! Check our articles for the most up-to-date information.
This Q&A thread was imported from our previous system and could apply to an older product.


  • We are working on a project that requires us to publish screen casts that may be in a variety of resolutions (dimensions).While we have already built our own player, I am still contemplating to use a 3.party product which is well tested, supports an extension model and comes with source. This could make us save some time as our project is already loaded with a lot of heavy work in many other areas. I have spend some time looking around and found that JW player may just fit the bill - however there is one issue that nags me - please allow me to explain.


    We have decided to always size the player to fill out the container (browser width=100% and Height=100%) to get a uniform look and feel. What we then want to achieve is that videos which have dimensions smaller than the player would simply be played in their original dimension (resolution) while videos which have a larger size than the size of the player would be resized to fit the player while maintaining aspect ratio.

    For presentation of screens casts this is a very logical approach - if you can get what was originally recorded then great, but if the size is bigger than the player the you will get a resized version.


    With respect to dynamic resizing of the video you have the following options:

    stretching (uniform,fill,exactfit,none)

    However for our use this does not cut it. If I set stretching(none) then the video gets cropped if the size is bigger than the player, which I guess is fair enough.

    However, my request would be to offer a fifth option - say "optimal" or "bestfit" which would basically constitute an 'intelligent' resize behavior. Do nothing {stretching(none)} when the video is smaller than the player and {stretching (uniform)} when the player canvas is smaller than the size of the original video.

    While this may be a small feature I believe that it would be a great asset. After all the primary function of the whole machine is what you see -;)


    PS: It could be that this could be done in javascript , but from a quick look this is only possible during initialization. (Weather this observation is right or wrong I would however still think that you should consider adding this small tweak - it simply makes sense.

    Best Regards,

    Henrik Levring

  • I’ll take a look at implementing this fifth option.

    This cannot be set through javascript, since flashvars cannot be re-set from javscript. It can be done through actionscript though. Perhaps a little stretching plugin, in which a user can select the option, might be a good one.

     
    Up Down 0 rated
  • Stretching can be set with right-click menu in current version of JW Player:

    Q. Has an API been added to set this with JavaScript?

    Up Down 0 rated
  • it's no good to require a user to right click the menu to set stretching...that's ridiculous. this should be easily set with actionscript or something. i don't see where the flashvar setting works for it either in version 4.

    Up Down 0 rated
  • Stretching works just fine in the player embedding code if you know what you're doing!

    Up Down 0 rated
  • It would be great if this was implemented.

    Up Down 0 rated
  • I have the exact same need, an ynews on when this could be implemented?

    Up Down 0 rated
  • There's currently no plan to implement this, but expect an update to ExactFit that does something along these lines:

    http://developer.longtailvideo.com/trac/ticket/606

    Up Down 0 rated
  • not sure that would serve my needs.
    I'm also doing some screen recording movies
    what I'd like:
    - when display size is smaller than movie, scale the movie down to display it all
    - when display size is larger than my movies (as when in full screen mode), do not stretch the movie (make text too blurry) but add black border for the movie to be displayed at its recording dimensions (for the text & other graphics to look nice & readable, not being resized)

    Any mean to get his behavior today? (looked around but haven't found any solution apart from editing the player code, how out my technical knowledge)

    Thx!

    Up Down 0 rated
  • Currently not possible, and there aren't currently any plans to add this.

    Up Down 0 rated
  • I also have a need for this feature. Does the plugin architecture allow for creating an option like Erwan describes?

    Up Down 0 rated
  • @BrianM -

    No, the plugin API doesn’t allow access to the media elements, so this wouldn’t be possible using plugins.

     
    Up Down 0 rated
  • The request posted and commented by many users is completely logical. And I have not see a comment that explains why it is not a desired behavior. In the matter of fact it is so logical and required that I do not see how you can use the player for screen cast videos without it. Who would ever want to stretch the media just because the container is larger - this lowers the quality. On the other hand if the container is smaller then a linear downsize is the only option.

    Erwan said it in a few words:
    - when display size is smaller than movie, scale the movie down to display it all
    - when display size is larger than my movies (as when in full screen mode), do not stretch the movie (make text too blurry) but add black border for the movie to be displayed at its recording dimensions (for the text & other graphics to look nice & readable, not being resized)

    I would almost go as far as to say *(I know some would disagree) that if the above is not the default behavior then it is basically a defect.

    - Well if JW will not provide this logical behavior I can add that it is the default behavior of Flowplayer.org, so there are other options.

    Up Down 0 rated
  • i have set size 1280x720 in 16:9 aspect ratio and JW player size was 640x360 it is also under in 16:9 aspect ratio....but i have black background in left and right side now ....so what can i do.....in how can i set stretching uniform setting permanently.

    Up Down 0 rated
  • @yeshdev – Set the stretching flashvar to exactfit. It will remove the bars.

     
    Up Down 0 rated
  • @Ethan,
    is it possible to have different stretching set for fullscreen as opposed to the default set in flashvar?

    I notice than while exactfit may be great for embedded videos when we switch to full screen there is still some skewing and pixeling. when the setting is changed to say, uniform, on fullscreen its perfect.

    Is that possible?

    thank you. great product and we are licensing the version 5 because of the new features as opposed to 3.99 which we had previously on our websites.

    Up Down 0 rated

  • See:*http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/4603/possible-to-restrict-video-size-in-full-screen*

    Up Down 0 rated
  • @Craterscore
    thanks but this is not a preferred solution for us to change the source of JWplayer.

    you see I do not know if the next new developer will understand this hard coded behaviour even exists. Secondly I do not know if the strecthing mode will remain same in window mode or full screen mode. The preferred way to do is using paremeters or variables because it is fairly certain that its a neccesity - we can fix embed sizes BUT We cannot guess all screen sizes and video sizes in fullscreen mode.

    Stretching to none in our case rsults in postage stamp size videos in full screen mode. (i know i can use your suggestion to just change it to something else).
    anyway thanks for the help but this is our roadblock with jwplayer.

    Up Down 0 rated
  • @Vangel, you should then look to pay a person (preferably someone from LongTail) to customize this aspect for you.

    Honestly I do not see a problem with setting the stretching option to uniform. Its the option that will fill as much as the screen as possible without changing the aspect ratio.

    Our site too expands to fill the screen of our users and we have no issues with the appearance of this setting.

    Up Down 0 rated
  • I just wanted to post that LongTail does not do custom work, so it would have to be someone outside of LongTail.

     
    Up Down 0 rated
  • can any one please show an example to use strecthing option using javascript API for jwplayer...

    Up Down 0 rated
  • i got that

    Up Down 0 rated
  • Demo – http://developer.longtailvideo.com/player/trunk/fl5/js/test/examples/stretching.html

     
    Up Down 0 rated
  • [for WordPress]
    I fixed this strange thing with the videos by using the Shadowbox JS Flash Vars settings in 'Advanced Configuration' ..the trick is to use the correct protocol. Which is very difficult to find. here is an example of the correct approach.

    Flash Vars
    {'stretching': 'exactfit'}

    these are the player settings possible:
    uniform
    fill
    exactfit
    bestfit
    none

    Up Down 0 rated

This QA is closed.

Still don't have JW Player? Get It Here