-
1. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Jan 22, 2014 8:08 AM (in response to Ojcrawford)The ideal option is to serve a non-scalable HTML5 option for desktops and the scalable html5 version for mobile/tablets.
Similar to what is happening in the multiscreen.html if you publish to both HTML and SWF, but publish a non-scalable version to a folder and a scalable version to a folder then redirect with the script.
-
2. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Ojcrawford Jan 23, 2014 12:56 AM (in response to TLCMediaDesign)Thanks, but we don't ever want to serve a completely non-scaling page as it won't work with browser window resizing lower than our project size.
I've managed to put a max-width on the flash version which does exactly what I need, but I can't get the same working on the html5 one.
-
3. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Jan 23, 2014 6:09 AM (in response to Ojcrawford)I understand your dilema.
My point was that if you only served the HTML5 version for mobile, you would never be able to scale over a max width anyway, since the largest screen would be a tablet.
Desktops would be served the SWF version, which is possible to control the max-width since there are only 2 divs you need to worry about and it could still scale down.
It's conceivably possible to do it with the HTML5 version but you would have to write a script to change the css for all divs, the container div and all of it's children and their children and you'd have to run it for every slide. As some of the divs have no id you would also have to create a new id for those divs, or apply a class before you could change their css. You'd probaby have to evaluate which divs have classes, which have inline css, to sum it up it would be a nightmare to write the code. CSS specificity can be confusing enough, let alone trying to figure it out dynamically. If you ever got it to work it would probably take longer than the time it took to build the course, let alone the latency it would introduce.
I'm sure you've noticed that when you apply css rules the the main container div has absolutely no effect in the HTML5 version since the child divs have their own set of rules.
-
4. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 12:45 AM (in response to Ojcrawford)Hi, Ojcrawford,
Did you ever resolve this issue i.e. no scaling up?
I have the same issue and am looking for a solution.
Regards
Trevor
-
5. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Sep 26, 2014 2:20 AM (in response to Monmouth LGF)In the CPM.js, find:
cp.shouldScale = cp.D.project.shc;
and replace with:
if (isMobile)
{
cp.shouldScale = cp.D.project.shc;
}
else
{
cp.shouldScale = false;
}
Then in the <head> of the Index.html add a mobile detecton script::
var isMobile;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
{
isMobile = true;
}
else
{
sMobile = false;
} -
6. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 3:04 AM (in response to TLCMediaDesign)Hi,
Thanks for the response, your support is most appreciated.
I have applied your fix but it is not working. This could be for the following reasons, please advise:
1) The CPM.js file is compiled. So I removed all the spaces in your replacement code before pasting over 'cp.shouldScale = cp.D.project.shc;' was this correct?
2) I don't have a file index.html. I have the file index_SCORM.html. I assume this is because I have SCORM tracking turned on. I placed the mobile detection script in that file at the bottom of the head section after the other scripts (in it's own script tags), was this correct?
Cheers
Trevor
-
7. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Sep 26, 2014 3:42 AM (in response to Monmouth LGF)I always run the CPM.js through jsPretty.com, then you can always minify it after your edits if you wish, but I just leave it unminified. But it should work the way you did it.
Put the dtection script at the top just above function initializeCP(), but it works at the bottom also:
If you copy and pasted the code from the previous post, in the isMobile = false, there was an "i" missing from the variable "sMobile" change it to "isMobile"
<script>
var isMobile;
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
{
isMobile = true;
}
else
{
isMobile = false;
}function initializeCP()
-
8. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 4:15 AM (in response to TLCMediaDesign)Hi Thanks for the extra information, I'll try jsPretty.
Yes I pasted the code typo into the file so that's most likely why it failed.
I'll find the fix again later.
Cheers
Trevor
-
9. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 5:52 AM (in response to TLCMediaDesign)Hi,
Should there be a ; (semi colon) at the very end of the replacement code which goes into CPM.js after the last } ?
trevor
-
10. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Sep 26, 2014 6:03 AM (in response to Monmouth LGF)No, not necessary.It looks like this:
cp.CPPreInit = function () {
cp.CPProjInit();
if (isMobile) {
cp.shouldScale = cp.D.project.shc;
} else {
cp.shouldScale = false;
}
cp.loadedModules = {
playbar: cp.D.playBarProperties.hasPlayBar && cp("playbar") != void 0,
border: cp.D.borderProperties.hasBorder,
toc: cp.D.project.hasTOC && cp("toc") != void 0
};
-
11. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 6:10 AM (in response to TLCMediaDesign)Ok thanks.
That's clear.
-
12. Re: Is it possible to only allow downward HTML / flash scaling of a project?
Monmouth LGF Sep 26, 2014 7:20 AM (in response to TLCMediaDesign)Hi Unfortunately this is still not working. No error messages when running, just the same scaling up on a desktop PC with high resolution screen.
I have double checked both pieces of code and can't see any mistakes.
Just checking but the fix should also applies to the swf version which loads on the PC, not just the hmtl5 version directed to the tablets?
Trevor
-
13. Re: Is it possible to only allow downward HTML / flash scaling of a project?
TLCMediaDesign Sep 26, 2014 7:32 AM (in response to Monmouth LGF)I haven't checked it against a swf version. I'll look at it when I have some time. I can zip up my file and send it to you so you can have a working version. PM me your info and I'll send you a link.

