Magazine example's

Magazine example #1

var myYumpu = new Yumpu();
document.addEventListener("DOMContentLoaded", function() {
	myYumpu.create_player("#myMagazineContainer", "55929647", {
		canvasBGColor: "#e65117",
		fallback_order: "hornet,html5,js"
	});
});

Result:

You should see a magazine in a <div> with a dimension of 600 x 744 px, with an orange background. The orange background is set within the additional parameters { ... canvasBGColor:"#e65117", ... }.

Use any color you like and place it in HEX color code. If you don't set this parameter then the background will be transparent. You can also set the <div>'s background color if you like with CSS.

The parameter { ... fallback_order:"hornet,html5,js", ... } will set the prefered technology. In this example you'll get the Hornet Player - if the browser doesn't support WebGL, then it will try to fallback to the second value "html5" and if your browser can't handle HTML5 it will show you our simple Javascript+HTML4 player.

Automatic fallback

As mentioned in the example above, you can set the "fallback_order" Parameter to force a certain technology. Every technology has it's advantages - the Hornet Player is faster and can handle the loading of images better than the HTML5 version; the HTML5 version on the other hand will run on desktop computers, as well as on mobile devices, and so on. But our automatic fallback procedure will provide users the best player technology anyway! On mobile devices a user will get our HTML5-mobile-player by default. In other words, you don't have to set this parameter, which is "hornet,html5,js" by default and you don't have to worry anyway.

Additional parameters

fallback_order

default: "hornet,html5,js"

order of technology to use as the player

singlepageViewOn

default: "0"

set "1" to see the magazine in a single page view

startpage

default: "1"

set any page number you want to magazine to jump on start

hideOuterShadows

default: "0"

set "1" to hide all shadow effects outside the magazine

hideInnerShadows

default: "0"

set "1" to hide all shadow effects inside the magazine

canvasBGColor

default: "transparent"

e.g. set "#00FF00" to get a green background in normal view

canvasFSBGColor

default: "standard"

e.g. set "#FF0000" to get a red background in fullscreen view

c2rOnOff

default: "on"

set "off" to completely hide the click-to-read-button

c2rText

default: "Click to read" [en]

set to any text you like to address a user to click, e.g. "Enlarge to fullscreen", etc.

c2rMode

default: "fullscreen"

the default value "fullscreen" will activate the fullscreen mode on click by the user. You can also set to "external" to redirect a user to another site. You can specify the URL with the next parameter "c2rURL".

c2rURL

default: "on"

set an URL/link, e.g. to any interesting website you want the user to redirect when clicking onto the button

embedded

default: false

When set to false, you'll see the magazin like you would se it on yumpu.com. If set to true the view changes a bit, as we deliver embedded magazines you normally see in our embed generator.

playerElementPageNumbers

default: "on"

set to "off" you'll hide the page numbers in the player

playerElementLogo

default: "on"

set to "off" you'll hide the logo

playerElementOverview

default: "on"

set to "off" you'll hide the overview at the bottom

playerElementFSShareLinks

default: "on"

set to "off" you'll hide the social sharing functions

playerElementFSDownload

default: "on"

set to "off" you'll hide the button with which you can download the magazines PDF

playerElementFSPrint

default: "on"

set to "off" you'll hide the print button in fullscreen mode

playerElementFSRecom

default: "on"

set to "off" you'll hide the recommendations on the right side in fullscreen mode

isFSOverlay

default: "0"

set to "1" you tell the frontend to be used as a magazine, which will be directly opened in fullscreen mode, hence showing the "X" (top right) to close the fullscreen mode. The frontend cannot detect this case for sure in all cases, which makes this parameter necessary.

lang

default: "en"

use your desired 2 digit language code (e.g. "en" = english, "it" = italian, "es" = spanish, and so on), so the frontend knows which language file it has to load, which affects especially the tooltip texts

disableMobileFullscreen

default: false

set to true you'll hide the fullscreen button on mobile devices

Magazine example #2

In the next example we'll create a magazine where we link the user directly to the index page ({startpage:"3"}). We also want to show it in the embed style ({... embedded:true}), show it as a single page ({singlepageViewOn:"1"}) and set the background green ({canvasBGColor:"#7a9986"}).

var myYumpu = new Yumpu();
document.addEventListener("DOMContentLoaded", function() {
	myYumpu.create_player("#myMagazineContainer", "55929647", {
		startpage: "3",
		embedded: true,
		singlepageViewOn: "1",
		canvasBGColor: "#7a9986",
		fallback_order: "hornet,html5,js"
	});
});

Result:

Last updated