Player SDK
Player SDK Requires Pro Plan
To embed a panorama into your website, besides using an iframe, you can also use Player SDK which gives you greater flexibility to control the panorama.
Key ID
The Key ID is used to confirm the identity of the caller. It is a string that starts with KI- and is followed by 32 random characters. It can be obtained from the Settings - Developer page.
Here are the steps to use the Player SDK:
-
Get Project ID from Project dashboard - Info panel.
-
Add Player SDK js file
https://common.easepano-cdn.com/sdk/easepanoPlayer.jsto your webpage.
<script src="https://common.easepano-cdn.com/sdk/easepanoPlayer.js"></script>
- Add a div to your webpage for displaying a panorama, and specify an id for the div.
<div id="panoContainer" style="width: 100%; height: 100%;"></div>
- Add the following script to your webpage, and replace the Key ID and Project ID with your own.
<script>
window.easepanoSetup({
target: 'panoContainer',
id: '{Project ID}',
keyID: '{Key ID}',
})
</script>
This is a complete example(demo.html).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>easepano SDK Sample</title>
<script src="https://common.easepano-cdn.com/sdk/easepanoSDK.js"></script>
</head>
<body>
<div id="panoContainer" style="width: 100%; height: 100%;"></div>
</body>
<script>
window.easepanoPlayerSetup({
target: 'panoContainer',
id: '1234567890',
keyID: 'KI-XXXXXXXXXXXXX',
})
</script>
</html>