diff --git a/README.md b/README.md index 735c38c..5323050 100644 --- a/README.md +++ b/README.md @@ -12,5 +12,3 @@ This project hosts samples for the [PAL SDKs](//developers.google.com/ad-manager Example PAL iOS setup. * [Cast](//github.com/googleads/googleads-pal/tree/main/cast) - Example PAL Cast setup. -* [CTV (Tizen)](//github.com/googleads/googleads-pal/tree/main/ctv/tizen) - - Example PAL CTV (Tizen) setup. diff --git a/ctv/tizen/config.xml b/ctv/tizen/config.xml deleted file mode 100644 index 7096c0d..0000000 --- a/ctv/tizen/config.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - BasicProject - - - - - - - - - - diff --git a/ctv/tizen/css/style.css b/ctv/tizen/css/style.css deleted file mode 100644 index bc3ec66..0000000 --- a/ctv/tizen/css/style.css +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright 2024 Google LLC - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -* { - font-family: Lucida Sans, Arial, Helvetica, sans-serif; -} - -body { - margin: 50px auto; - background-color: #fff; -} - -header h1 { - font-size: 108px; - margin: 0; -} - -header h2 { - font-size: 54px; - margin: 0; - color: #888; - font-style: italic; -} - -nav ul { - list-style: none; - padding: 20px; - display: block; - clear: right; - background-color: #666; - padding-left: 4px; - height: 48px; -} - -nav ul li { - display: inline; - padding: 0 20px 5px 10px; - border-right: 1px solid #ccc; -} - -nav ul li a { - color: #efd3d3; - text-decoration: none; - font-size: 39px; - font-weight: bold; -} - -nav ul li a:hover { - color: #fff; -} - -article > header h1 { - font-size: 60px; - margin-left: 14px; -} - -article > header h1 a { - color: #993; -} - -article > header h1 img { - vertical-align:middle; -} - -article > section header h1 { - font-size: 48px; -} - -article p { - clear: both; -} - -footer p { - text-align: center; - font-size: 36px; - color: #888; - margin-top: 30px; -} diff --git a/ctv/tizen/icon.png b/ctv/tizen/icon.png deleted file mode 100644 index 9765b1b..0000000 Binary files a/ctv/tizen/icon.png and /dev/null differ diff --git a/ctv/tizen/images/tizen_32.png b/ctv/tizen/images/tizen_32.png deleted file mode 100644 index 647c3f9..0000000 Binary files a/ctv/tizen/images/tizen_32.png and /dev/null differ diff --git a/ctv/tizen/index.html b/ctv/tizen/index.html deleted file mode 100644 index 48bc817..0000000 --- a/ctv/tizen/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - Tizen app for PAL sdk - - - - - - -
-
-

Tizen app for PAL sdk

-
-
-
-
- - diff --git a/ctv/tizen/js/pal.js b/ctv/tizen/js/pal.js deleted file mode 100644 index 70a4c32..0000000 --- a/ctv/tizen/js/pal.js +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright 2024 Google LLC - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -let videoElement; -let nonceLoader; -let managerPromise; -let nonceManager; -let storageConsent = true; -let playbackStarted = false; - -/** - * A placeholder for the publisher's own method of obtaining user - * consent, either by integrating with a CMP or based on other - * methods the publisher chooses to handle storage consent. - * @return {boolean} Whether storage consent has been given. - */ -function getConsentToStorage() { - return storageConsent; -} - -/** - * Initializes the PAL loader. - */ -function init() { - const videoElement = document.getElementById('placeholder-video'); - videoElement.addEventListener('mousedown', onVideoTouch); - videoElement.addEventListener('touchstart', onVideoTouch); - videoElement.addEventListener('play', function() { - if (!playbackStarted) { - sendPlaybackStart(); - playbackStarted = true; - } - }); - videoElement.addEventListener('ended', sendPlaybackEnd); - videoElement.addEventListener('error', function() { - log("Video error: " + videoElement.error.message); - sendPlaybackEnd(); - }); - - document.addEventListener('keydown', function(e) { - // Fake ad click, video touch, playback start and end events using remote. - switch(e.keyCode) { - case 37: // LEFT arrow - log('sendAdClick'); - sendAdClick(); - break; - case 38: // UP arrow - log('onVideoTouch'); - onVideoTouch(); - break; - case 39: // RIGHT arrow - log('sendPlaybackStart'); - sendPlaybackStart(); - break; - case 40: // DOWN arrow - log('sendPlaybackEnd'); - sendPlaybackEnd(); - break; - case 10009: // RETURN button - tizen.application.getCurrentApplication().exit(); - break; - case 13: // OK button - // Clear log. - document.getElementById('logOutput').innerHTML = ''; - break; - default: - log('Key code : ' + e.keyCode); - break; - } - }); - generateNonce(); -} - -/** - * Generates a nonce with sample arguments and logs it to the console. - */ -function generateNonce() { - // The default value for `allowStorage` is false, but can be - // changed once the appropriate consent has been gathered. - const consentSettings = new goog.ctv.pal.ConsentSettings(); - consentSettings.allowStorage = getConsentToStorage(); - nonceLoader = new goog.ctv.pal.NonceLoader(consentSettings); - const request = new goog.ctv.pal.NonceRequest(); - request.adWillAutoPlay = true; - request.adWillPlayMuted = true; - request.continuousPlayback = false; - request.descriptionUrl = 'https://example.com'; - request.iconsSupported = true; - request.playerType = 'Sample Player Type'; - request.playerVersion = '1.0'; - request.ppid = 'Sample PPID'; - request.sessionId = 'Sample SID'; - // Player support for VPAID 2.0, OMID 1.0, and SIMID 1.1 - request.supportedApiFrameworks = '2,7,9'; - request.url = 'https://developers.google.com/ad-manager/pal/ctv'; - request.videoHeight = 480; - request.videoWidth = 640; - - managerPromise = nonceLoader.loadNonceManager(request); - managerPromise - .then(function(manager) { - nonceManager = manager; - log('Nonce generated: ' + manager.getNonce()); - }); -} - -/** - * Informs PAL that an ad click has occurred. How this function is - * called will vary depending on your ad implementation. - */ -function sendAdClick() { - if (nonceManager) { - nonceManager.sendAdClick(); - } -} - -/** - * Handles the user touching on the video element, passing it to PAL. - * @param {!TouchEvent|!MouseEvent} touchEvent - */ -function onVideoTouch(touchEvent) { - if (nonceManager) { - nonceManager.sendAdTouch(touchEvent); - } -} - -/** Informs PAL that playback has started. */ -function sendPlaybackStart() { - if (nonceManager) { - nonceManager.sendPlaybackStart(); - } -} - -/** Informs PAL that playback has ended. */ -function sendPlaybackEnd() { - if (nonceManager) { - nonceManager.sendPlaybackEnd(); - } -} - -/** - * Outputs log. - * @param {string} msg - */ -function log(msg) { - const logOutput = document.getElementById('logOutput'); - logOutput.innerHTML = msg + '
' + logOutput.innerHTML; -} - -window.addEventListener("load", function(event) { - init(); -});