-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex.html
59 lines (49 loc) · 4.32 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sunbird PDF player</title>
<link rel="stylesheet" href="./styles.css">
<style>
.player-grid {
height: 90vh;
;
width: 90%;
margin: 0 auto;
display: grid;
gap: 1.5rem;
padding-top: 4rem;
@media screen and (max-width:768px) {
grid-template-columns: 100%;
gap: 0px;
}
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"
integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg=="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reflect-metadata/0.1.13/Reflect.min.js"
integrity="sha512-jvbPH2TH5BSZumEfOJZn9IV+5bSwwN+qG4dvthYe3KCGC3/9HmxZ4phADbt9Pfcp+XSyyfc2vGZ/RMsSUZ9tbQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<div class="player-grid" id="my-player">
</div>
<script type="text/javascript" src="sunbird-pdf-player.js"></script>
<script type="text/javascript">
const playerConfig = {"context":{"mode":"play","partner":[],"pdata":{"id":"dev.sunbird.portal","ver":"5.2.0","pid":"sunbird-portal"},"contentId":"do_21374910251798528014586","sid":"6d1898db-d783-4f83-8b92-4a36636e0d2f","uid":"anonymous","timeDiff":-0.089,"channel":"01269878797503692810","tags":["01269878797503692810"],"did":"3ca74a4c5fbce6b7b7f5cd12cebb1682","contextRollup":{"l1":"01269878797503692810"},"objectRollup":{},"userData":{"firstName":"Guest","lastName":""}},"config":{"showEndPage":false,"endPage":[{"template":"assessment","contentType":["SelfAssess"]}],"showStartPage":true,"host":"","overlay":{"showUser":false},"splash":{"text":"","icon":"","bgImage":"assets/icons/splacebackground_1.png","webLink":""},"apislug":"/action","repos":["/sunbird-plugins/renderer"],"plugins":[{"id":"org.sunbird.iframeEvent","ver":1,"type":"plugin"},{"id":"org.sunbird.player.endpage","ver":1.1,"type":"plugin"}],"sideMenu":{"showShare":true,"showDownload":true,"showExit":false}},"metadata":{"copyright":"2009","subject":["Environmental Studies"],"channel":"01345815127107174426","language":["English"],"mimeType":"application/pdf","objectType":"Content","gradeLevel":["Class 3"],"appIcon":"","primaryCategory":"eTextbook","artifactUrl":"https://obj.stage.sunbirded.org/sunbird-content-staging/content/do_21374910251798528014586/artifact/cbse-sample-paper-for-class-1-.pdf","contentType":"eTextBook","identifier":"do_21374910251798528014586","audience":["Student"],"visibility":"Default","author":"Aparna-sri","mediaType":"content","osId":"org.ekstep.quiz.app","languageCode":["en"],"license":"CC BY 4.0","name":"pdf-pdf-pdf-pdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-pdfpdf-pdf-p","status":"Live","code":"0534f774-b873-d46d-a46b-bde6a68985dc","interceptionPoints":{},"streamingUrl":"https://obj.stage.sunbirded.org/sunbird-content-staging/content/do_21374910251798528014586/artifact/cbse-sample-paper-for-class-1-.pdf","medium":["English"],"createdOn":"2023-03-13T13:16:54.093+0000","lastUpdatedOn":"2023-03-13T13:17:03.060+0000","originData":{"identifier":"do_21374910251798528014586","repository":"https://dockstaging.sunbirded.org/api/content/v1/read/do_21374910251798528014586"},"creator":"Aparna-sri","pkgVersion":1,"versionKey":"1678713416428","framework":"ekstep_ncert_k-12","createdBy":"703f836a-353b-43f4-83fb-b440e7ee9302","orgDetails":{"email":null,"orgName":"Globe"},"licenseDetails":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/legalcode","description":"For details see below:"}},"data":{}};
const pdfElement = document.createElement('sunbird-pdf-player');
pdfElement.setAttribute('player-config', JSON.stringify(playerConfig));
pdfElement.addEventListener('playerEvent', (event) => {
console.log("On playerEvent", event);
});
pdfElement.addEventListener('telemetryEvent', (event) => {
console.log("On telemetryEvent", event);
});
const myPlayer = document.getElementById("my-player");
myPlayer.appendChild(pdfElement);
</script>
</body>
</html>