광고 스트림 북마크 저장 및 로드
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 가이드에서는 IMA DAI SDK를 사용하여 북마크를 구현하는 방법을 보여줍니다.
을 사용해야 합니다.
위의 예제에 표시된 것과 같이 작동하는 IMA DAI 구현이
시작하기
북마크란 무엇인가요?
북마크는 저장한 다음 특정 지점으로 돌아갈 수 있는 기능입니다.
콘텐츠를 스트리밍할 수 있습니다. 사용자가 콘텐츠를 5분 동안 시청한다고 가정해 보겠습니다.
동영상 스트림을 나갔다가 돌아옵니다. 북마크를 추가하면
스트림 내 사용자의 위치를 뜻합니다.
시청자에게 원활한 경험을 제공합니다.
DAI 북마크 심층 분석
DAI 스트림을 북마크에 추가할 때 스트림 ID와 시간을 기록해야 합니다.
사용자가 동영상에서 나갈 때 사용자가 돌아오면
스트리밍하고 저장된 시간을 탐색합니다. 요청된 각 인스턴스가
스트림을 저장하면 재생 시간이 다른 광고 시점을 사용할 수 있음
소용이 없을 거에요. 정말로 하고 싶은 일은
콘텐츠 시간
필요한 변환 방법
IMA DAI SDK는 콘텐츠 시간을 요청하는 메서드 쌍을 제공합니다.
특정 스트리밍 시간 및 특정 콘텐츠의 스트리밍 시간
있습니다. 이러한 변환 방법을 사용하면 북마크한 데이터를
콘텐츠 시간 다음 스트림 시간까지 탐색
스트림의 새 인스턴스를 반환합니다. 이 접근 방식은 다음과 같습니다.
작동하는 북마크 구현을 보여주는 샘플 앱으로 이동합니다.
북마크 저장 중
활동이 일시중지되면 북마크를 저장합니다.
Saves the current time as a bookmark in the current video.
Function saveBookmarkTime(player as Object, streamManager as Object) as Void
m.videos[player.video.index].bookmarkTime =
streamManager.getContentTime(player.currentTime * 1000)
End Function
북마크 로드 중
스트림을 다시 요청할 때 북마크를 로드합니다. Cloud Functions는
VideoStreamPlayer
인터페이스
player.loadUrl = Function(streamInfo as Object)
...
If m.video.bookmarkTime > 0
streamTime = m.streamManager.getStreamTime(m.video.bookmarkTime)
m.videoPlayer.seek(streamTime)
End If
End Function
샘플 앱
샘플 앱
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[[["\u003cp\u003eThis guide explains how to implement bookmarking in video-on-demand (VOD) streams using the IMA DAI SDK for Roku, allowing users to resume playback from where they left off.\u003c/p\u003e\n"],["\u003cp\u003eBookmarking with DAI involves saving the content time, not just the stream time, to ensure accurate resumption due to potential ad break variations.\u003c/p\u003e\n"],["\u003cp\u003eThe IMA DAI SDK provides methods to convert between stream time and content time, enabling the storage and retrieval of bookmarks based on content progress.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can implement bookmarking by saving the content time when the video is paused and retrieving it to seek to the corresponding stream time when the stream is reloaded.\u003c/p\u003e\n"],["\u003cp\u003eA sample app demonstrating a working bookmarking implementation is available on GitHub for reference and further exploration.\u003c/p\u003e\n"]]],[],null,["# Save and load ad stream bookmarks\n\nThis guide shows how to implement bookmarking using the IMA DAI SDK\nwhen using Dynamic Ad Insertion (DAI) for video-on-demand (VOD) streams.\nThis assumes a working IMA DAI implementation, such as the one presented in\n\n\n[Get Started](/interactive-media-ads/docs/sdks/roku/dai).\n\n\nWhat is bookmarking?\n--------------------\n\nBookmarking is the ability to save and then return to a specific point\nin the content stream. Suppose a user watches five minutes of content,\nleaves the video stream, and then returns to it. Bookmarking saves the\nuser's position in the stream so the stream can pick up from where it\nleft off, providing a seamless experience to the viewer.\n\nDAI bookmarking under the hood\n------------------------------\n\nWhen bookmarking a DAI stream, you must record the stream id and time\nwhen the user leaves the video. When the user returns, re-request the\nstream and seek to the saved time. Since each instance of the requested\nstream can have ad breaks of different durations simply saving the stream\ntime won't work. What you really want to do is continue from the same\n**content time**.\n\nConversion methods to the rescue\n--------------------------------\n\nThe IMA DAI SDK provides a pair of methods to request the **content time**\nfor a given **stream time** and the **stream time** for a given **content\ntime** . Using these conversion methods you can store the bookmarked\n**content time** and then seek to the corresponding **stream time** in\nthe new instance of the stream. Here's the approach, including a link\nto a sample app that shows a working bookmarking implementation.\n\nSaving bookmarks\n----------------\n\nSave a bookmark when the Activity is paused. \n\n Saves the current time as a bookmark in the current video.\n Function saveBookmarkTime(player as Object, streamManager as Object) as Void\n m.videos[player.video.index].bookmarkTime =\n streamManager.getContentTime(player.currentTime * 1000)\n End Function\n\nLoading bookmarks\n-----------------\n\nLoad the bookmark when re-requesting a stream. It's part of implementing\nthe `VideoStreamPlayer` interface. \n\n player.loadUrl = Function(streamInfo as Object)\n ...\n If m.video.bookmarkTime \u003e 0\n streamTime = m.streamManager.getStreamTime(m.video.bookmarkTime)\n m.videoPlayer.seek(streamTime)\n End If\n End Function\n\nSample app\n----------\n\n[Sample app](//github.com/googleads/googleads-ima-roku-dai)"]]