Avatar

Correct answer by
Level 10

Hi Adam,

If you look at the source code of StreamManager.as in the player 9 source we provide, we have three set of values for native width/height. I will copy them here

/**

  • @private

*/

public static const AR_PORTRAIT_W:Number = 144;

/**

  • @private

*/

public static const AR_PORTRAIT_H:Number = 112;

/**

  • @private

*/

public static const AR_STANDARD_W:Number = 128;

/**

  • @private

*/

public static const AR_STANDARD_H:Number = 128;

/**

  • @private

*/

public static const AR_LANDSCAPE_W:Number = 160;

/**

  • @private

*/

public static const AR_LANDSCAPE_H:Number = 96;

By default, we use the standard values for nativeWidth and nativeHeight i.e. 128 and 128. When you specify a reslotion factor, the native width and height doesn't change but the capture width and height is multiplied by the factor in

camera.setMode(StreamManager.ARSTANDARD_WresolutionFactor, StreamManager.AR_STANDARD_H resolutionFactor, _fps);

So, if you are setting resolution factor as 3 it will do for standard

_camera.setMode(1283, 1283, _fps); though the native width and height remains the same.

If you want to change them, you need to override the createMyStream function in WebcamPublisher.as and change the nativeWidth and nativeHeight( the code is same for 9 and 10, so even If you are using player 10 swc, you can refer to 9 source of this function), but you don't need to do the native width and height, just changing the resolutionFactor should change the capture width/height for you.

Please refer to updateSettings and createMyStream functions in the source code of WebcamPublisher.as for further clarity.

Hope this helps.

Thanks

Hironmay Basu

View solution in original post