• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1152
  • Last Modified:

Resize flash flv player component

I would like to resize the flash flv player on my page based on the video size,
my aim is to resize the player to match the video width and height so that the user can view the video in actual size...

i think i can do this by changing the player height and width but it's not working for me... it resizes but not correctly...

is there any other way to show the video in actual size?

currently i  am trying with something like this...

_root.player2.width=_root.plwidth;
_root.player2.height=_root.plheight;

i pass .plheight and .plwidth as parameter from the html into flash.

I use Flash 8.

thanks in advance...


0
str_kani
Asked:
str_kani
  • 4
  • 3
  • 2
  • +2
4 Solutions
 
Dushan De SilvaCommented:
Sometimes following solutions might hepl for you.

http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21736451.html


HERE IS THE CODE:
-----------------------
//I assumed that "FLVPBack" is the "FLVPlayback" component instance name in your FLA
// so replace it with ur "FLVPlayback" component instance name.
this.onEnterFrame = function()
{
     
     this._x = this._parent.FLVPBack._x;
     this._y = this._parent.FLVPBack._y;
     this._width = this._parent.FLVPBack.__width;//important,  keep the double underscore, it is not by mistake
     this._height = this._parent.FLVPBack.__height;//important,  keep the double underscore, it is not by mistake
};
---------------------

BR Dushan
0
 
str_kaniAuthor Commented:
This doesn't change the size accurately, it set the size correctly if we send 500 400 etc, but i need to send 452,253 etc , please help
0
 
wings_gauravCommented:
This should help -

_root.player2.aspectRatio = false;

-wings
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
str_kaniAuthor Commented:
can you please give me a working sample of this? i use flash 8
0
 
GuicCommented:
Hi,

Do that, it will help you :

Stage.scaleMode=noscale;


Regards
0
 
Aneesh ChopraCommented:
Hi,

Flash 8 FLVPlayback component support autoSize property.. just set it true... it will resize the FLVPlayback component automatically according to the video size...

default value for autoSize property is false...

just add the following line of code to enable it:
(I assume your FLVPlayback instance is on _root and its name is "player2")
------------
_root.player2.autoSize = true;
-----------

Rgds
Aneesh
0
 
str_kaniAuthor Commented:
almost there!
it resized the player... but not quite i wanted. Example:

I have my document size 200x200 and i would like to see a video of size 400x300

now the flash resizes the flvplay back automatically,,  problem arise if the document is smaller than that.
I mean the video doesn't display fully.. please try with a sample flv but have a smaller flash document size than the video.

we are almost there!
0
 
Aneesh ChopraCommented:
in your query, u have request the solution to play the video in its original size,
that's what I suggested,,,


please explain what exactly you want,,,, everything is possible, just it should be feasible...

Rgds
Aneesh
0
 
str_kaniAuthor Commented:
i have 10 video files all are of different sizes, say 100x200, 100x100, 800x600 etc...

i like to pass the video name dynamically and show the video in acutual size, this page will not have anything but the player. so i have created a flash .fla file with 100x100 width and height. now i need this to resize it self (document and the flv player inside to show the video in acutual size), in your idea it resizes the flv player fine when i set that auto_resize property... but the document is not show the video in actual size if the video size if larger than the flv video size... Hope this clears you. please let me know if you need more details...
0
 
Aneesh ChopraCommented:
my suggest is, create the FLA with the size that matches the largest video size..
this way, swf will be able to show the video in all size...

In simple words, resizing the embedded swf size is not possible...
0
 
GuicCommented:
I suggest to have a xml list with the name and the size of the videos.
And open your player in another window that will matches exactly the good size.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now