-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
834672e
commit 2b393dd
Showing
14 changed files
with
458 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>SEO Plugin</title> | ||
<script src="https://unpkg.com/@playkit-js/kaltura-player-js@canary/dist/kaltura-ovp-player.js"></script> | ||
<script src="https://unpkg.com/@playkit-js/playkit-js-kaltura-cuepoints@canary/dist/playkit-kaltura-cuepoints.js"></script> | ||
<script src="../../playkit-seo.js"></script> | ||
</head> | ||
<body> | ||
<h1>Child(Player) Page</h1> | ||
<div id="player-placeholder" style="width: 640px; height: 360px"></div> | ||
<script> | ||
const config = { | ||
logLevel: 'DEBUG', | ||
targetId: 'player-placeholder', | ||
provider: { | ||
partnerId: 1804331, | ||
env: { | ||
serviceUrl: 'https://cdnapisec.kaltura.com/api_v3' | ||
} | ||
}, | ||
playback: { | ||
// In real scenario - preload mode should be automatically activated in studio | ||
preload: 'auto' | ||
}, | ||
plugins: { | ||
seo: { | ||
baseSegmentsUrl: 'https://www.example.com/example?t=' | ||
}, | ||
kalturaCuepoints: {} | ||
} | ||
}; | ||
|
||
const player = KalturaPlayer.setup(config); | ||
|
||
player.loadMedia({ entryId: '1_r62g23gz' }); | ||
</script> | ||
<a href="./parent.html">Parent(host) >>>></a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Parent-2 Page</title> | ||
</head> | ||
<body> | ||
<h1>Parent(Player host) Page</h1> | ||
<iframe id="myIframe" src="index.html" style="width: 640px; height: 460px"></iframe> | ||
|
||
<script> | ||
// Listen for messages from the iframe | ||
window.addEventListener('message', (event) => { | ||
if (event.data.type === 'SEOStructuredData') { | ||
console.log(`Event ${event.data.type} fired in iframe:`, event.data); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>SEO Plugin</title> | ||
<script src="https://unpkg.com/@playkit-js/kaltura-player-js@latest/dist/kaltura-ovp-player.js"></script> | ||
<script src="https://unpkg.com/@playkit-js/playkit-js-kaltura-cuepoints@latest/dist/playkit-kaltura-cuepoints.js"></script> | ||
<script src="https://unpkg.com/@playkit-js/playkit-js-seo@latest/dist/playkit-seo.js"></script> | ||
</head> | ||
<body> | ||
<h1>Child(Player) Page</h1> | ||
<div id="player-placeholder" style="width: 640px; height: 360px"></div> | ||
<script> | ||
const config = { | ||
logLevel: 'DEBUG', | ||
targetId: 'player-placeholder', | ||
provider: { | ||
partnerId: 1804331, | ||
env: { | ||
serviceUrl: 'https://cdnapisec.kaltura.com/api_v3' | ||
} | ||
}, | ||
playback: { | ||
// In real scenario - preload mode should be automatically activated in studio | ||
preload: 'auto' | ||
}, | ||
plugins: { | ||
seo: { | ||
baseSegmentsUrl: 'https://www.example.com/example?t=' | ||
}, | ||
kalturaCuepoints: {} | ||
} | ||
}; | ||
|
||
const player = KalturaPlayer.setup(config); | ||
player.loadMedia({ entryId: '1_r62g23gz' }); | ||
</script> | ||
<a href="./parent.html">Parent(host) >>>></a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Parent-2 Page</title> | ||
</head> | ||
<body> | ||
<h1>Parent(Player host) Page</h1> | ||
<iframe id="myIframe" src="index.html" style="width: 640px; height: 460px"></iframe> | ||
|
||
<script> | ||
// Listen for messages from the iframe | ||
window.addEventListener('message', (event) => { | ||
if (event.data.type === 'SEOStructuredData') { | ||
console.log(`Event ${event.data.type} fired in iframe:`, event); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @public | ||
* @param {string} durationInSeconds - duration in Seconds | ||
* @return {string} - The evaluated string | ||
*/ | ||
export function convertDurationToISO8601(durationInSeconds: number): string { | ||
const seconds = Math.floor(durationInSeconds % 60); | ||
const minutes = Math.floor((durationInSeconds / 60) % 60); | ||
const hours = Math.floor((durationInSeconds / (60 * 60)) % 24); | ||
const days = Math.floor(durationInSeconds / (60 * 60 * 24)); | ||
|
||
const paddedHours = hours.toString().padStart(2, '0'); | ||
const paddedMinutes = minutes.toString().padStart(2, '0'); | ||
|
||
const isoDuration = `P${days || ''}DT${paddedHours}H${paddedMinutes}M${seconds}S`; | ||
return isoDuration; | ||
} | ||
|
||
/** | ||
* @public | ||
* @param {string} unixTimestamp - date in Unix timestamp format | ||
* @return {string} - The evaluated string in ISO 8601 format without the UTC offset | ||
*/ | ||
export function convertUnixTimestampToISO8601(unixTimestamp: number): string { | ||
const milliseconds = unixTimestamp * 1000; | ||
const date = new Date(milliseconds); | ||
const iso8601Date = date.toISOString().replace('.000Z', '+00:00'); | ||
return iso8601Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { registerPlugin } from '@playkit-js/kaltura-player-js'; | ||
import { pluginName, Seo } from './seo'; | ||
import { PLUGIN_NAME, Seo } from './seo'; | ||
|
||
registerPlugin(pluginName, Seo); | ||
registerPlugin(PLUGIN_NAME, Seo); |
Oops, something went wrong.