CocosJs multi resolution issue

CocosJs multi resolution issue
0

Issue when I load the game in mobile browser.

var scaleFactor;
var workingArea;

var pDirector = cc.director;
var pEGLView = cc.view;

var mediumResource = cc.size(720, 1280);
var largeResource = cc.size(1536, 2048);
var designResolutionSize = cc.size(1536, 2048);

//pDirector.setOpenGLView(pEGLView);
var frameSize = pEGLView.getFrameSize();

var genericDeviceWidth = (frameSize.width > frameSize.height) ? frameSize.width :
frameSize.height;
var genericDeviceHeight = (frameSize.width > frameSize.height) ? frameSize.height :
frameSize.width;

// 2160 h 1080
if (cc.sys.platform === cc.sys.DESKTOP_BROWSER)
cc.view.setDesignResolutionSize(frameSize.width, frameSize.height, cc.ResolutionPolicy.SHOW_ALL);
else
cc.view.setDesignResolutionSize(frameSize.width, frameSize.height, cc.ResolutionPolicy.NO_BORDER);

pEGLView.adjustViewPort(true);
pEGLView.resizeWithBrowserSize(true);
cc.director.setProjection(cc.Director.PROJECTION_2D);
// Set resources path
cc.loader.resPath = “res”;

var scaleFactor = mediumResource.width / frameSize.width;
if (mediumResource.width <= frameSize.width)
scaleFactor = mediumResource.height / frameSize.height;
pDirector.setContentScaleFactor(scaleFactor);
cc.loader.resPath = “res/Normal”;