단일 콘텐츠 재생 세션의 nonce와 이벤트 보고를 관리합니다.
프로그래매틱 수익 창출을 사용 설정하려면 sendAdClick, sendTouch, sendPlaybackStart, sendPlaybackEnd를 비롯한 콘텐츠 재생 세션 수명 주기 메서드를 각 이벤트가 발생할 때 호출해야 합니다.
메서드
getNonce
public
getNonce()는 문자열을 반환합니다.
반환 값
string 관리자가 로드될 때 생성된 nonce입니다.
이 값은 지정된 NonceManager 인스턴스에 대해 변경되지 않습니다. 이 nonce 값은 최대 6시간의 단일 콘텐츠 재생 세션에만 유효합니다.
sendAdClick
public
sendAdClick()이 void를 반환함
지정된 콘텐츠 재생 세션 중에 광고 클릭이 발생했음을 Google 광고 서버에 알립니다.
반환 값
void
sendAdImpression
public
sendAdImpression()이 void를 반환함
이 관리자가 생성한 nonce로 요청된 광고의 첫 번째 프레임이 표시될 때 호출해야 합니다.
지원 중단됨
대신 `sendPlaybackStart` 및 `sendPlaybackEnd` 를 사용하세요.
반환 값
void
sendAdTouch
public
sendAdTouch(userInteractionEvent)는 void를 반환합니다.
클릭연결을 제외한 광고에 대한 사용자 터치 또는 클릭 (예: 건너뛰기, 음소거, 탭 등)이 지정된 콘텐츠 재생 세션 중에 발생했음을 Google 광고 서버에 알립니다.
매개변수
userInteractionEvent
cast.framework.events.Event
Cast 프레임워크에서 발생한 사용자 상호작용 이벤트입니다.
값은 null이 아니어야 합니다.
반환 값
void
sendPlaybackEnd
public
sendPlaybackEnd()는 void를 반환합니다.
지정된 콘텐츠 재생 세션의 재생이 종료되었음을 Google 광고 서버에 알립니다. 재생이 종료될 때 호출해야 합니다 (예: 플레이어가 스트림 끝에 도달하거나, 사용자가 중간에 재생을 종료하거나, 사용자가 페이지를 나가거나, 재생목록 설정에서 다음 콘텐츠 항목으로 이동하는 경우).
이 메서드는 sendPlaybackStart에서 시작된 Google 서버에 대한 비동기 호출을 종료합니다.
반환 값
void
sendPlaybackStart
public
sendPlaybackStart()는 void를 반환합니다.
지정된 콘텐츠 재생 세션의 재생이 시작되었음을 Google 광고 서버에 알립니다. '동영상 플레이어 시작' 시 호출해야 합니다. 이는 사용자 시작 작업 (클릭하여 재생) 또는 페이지 시작 작업 (자동 재생)에 대한 응답일 수 있습니다.
이 메서드는 IVT 모니터링 및 감지에 필요한 신호를 수집하기 위해 Google 서버에 비동기 호출을 시작합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThe NonceManager class manages a unique nonce and reports events for a single content playback session, enabling programmatic monetization.\u003c/p\u003e\n"],["\u003cp\u003eTo enable programmatic monetization, you must call specific lifecycle methods like \u003ccode\u003esendAdClick\u003c/code\u003e, \u003ccode\u003esendTouch\u003c/code\u003e, \u003ccode\u003esendPlaybackStart\u003c/code\u003e, and \u003ccode\u003esendPlaybackEnd\u003c/code\u003e when their corresponding events occur.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetNonce()\u003c/code\u003e provides a unique nonce for the session, valid for a single playback up to 6 hours.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esendPlaybackStart()\u003c/code\u003e and \u003ccode\u003esendPlaybackEnd()\u003c/code\u003e should be used to signal the start and end of content playback to Google ad servers, replacing the deprecated \u003ccode\u003esendAdImpression\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eOther methods like \u003ccode\u003esendAdClick\u003c/code\u003e and \u003ccode\u003esendAdTouch\u003c/code\u003e allow reporting of ad interactions for comprehensive monetization tracking.\u003c/p\u003e\n"]]],["The `NonceManager` class manages a unique nonce for a single content playback session, valid for up to 6 hours. Key actions include: retrieving the nonce via `getNonce()`; notifying ad server events with `sendAdClick()`, `sendAdTouch()`, and `sendAdImpression()`; and signaling the start and end of a playback session via `sendPlaybackStart()` and `sendPlaybackEnd()`. `sendPlaybackStart()` begins background monitoring while `sendPlaybackEnd()` concludes it.\n"],null,["# Class: NonceManager\n\nNonceManager\n============\n\nclass public\n\nManages a nonce and its event reporting for a single content playback\nsession.\nThe content playback session lifecycle methods, including `sendAdClick`,\n`sendTouch`, `sendPlaybackStart`, and `sendPlaybackEnd` must be called as\nthese respective events occur in order to enable programmatic monetization.\n\nMethods\n-------\n\n### getNonce\n\npublic\n\ngetNonce() returns string\n\nReturns\n\n: `string` The nonce generated for this manager when it was loaded.\n This value will never change for a given `NonceManager` instance. This nonce value is only valid for a single content playback session up to a maximum duration of 6 hours.\n\n### sendAdClick\n\npublic\n\nsendAdClick() returns void\n\nNotifies Google ad servers that a clickthrough on an ad has occurred during\nthe given content playback session.\n\nReturns\n\n: `void`\n\n### sendAdImpression\n\npublic\n\nsendAdImpression() returns void\n\nShould be called when the first frame of the ad that was requested with\nthe nonce generated by this manager is displayed.\n\nDeprecated\n: Use \\`sendPlaybackStart\\` and \\`sendPlaybackEnd\\` instead.\n\nReturns\n\n: `void`\n\n### sendAdTouch\n\npublic\n\nsendAdTouch(userInteractionEvent) returns void\n\nNotifies Google ad servers that a user touch or click on the ad other than\na clickthrough (e.g. skip, mute, tap, etc.) has occurred during the given\ncontent playback session.\n\n| #### Parameter ||\n|----------------------|-------------------------------------------------------------------------------------------------------------|\n| userInteractionEvent | cast.framework.events.Event The user interaction event fired by the Cast framework. Value must not be null. |\n\nReturns\n\n: `void`\n\n### sendPlaybackEnd\n\npublic\n\nsendPlaybackEnd() returns void\n\nNotifies Google ad servers that playback for the given content playback\nsession has ended. This should be called when playback ends (e.g. when the\nplayer reaches end of stream, or when the user exits playback mid-way, or\nwhen the user leaves the page, or when advancing to the next content item\nin a playlist setting).\n\nThis method ends the asynchronous calls to Google servers started in\n`sendPlaybackStart`.\n\nReturns\n\n: `void`\n\n### sendPlaybackStart\n\npublic\n\nsendPlaybackStart() returns void\n\nNotifies Google ad servers that playback for the given content playback\nsession has started. This should be called on \"video player start\". This\nmay be in response to a user-initiated action (click-to-play) or a page\ninitiated action (autoplay).\n\nThis method will start asynchronous calls to Google servers to collect\nsignals needed for IVT monitoring and detection.\n\nReturns\n\n: `void`"]]