iOS에서 챕터 및 세그먼트 추적 track-chapters-and-segments-on-ios
다음은 2.x SDK를 사용하는 구현과 관련된 지침입니다.
IMPORTANT
SDK의 1.x 버전을 구현하는 경우 SDK 다운로드에서 개발자 안내서를 다운로드할 수 있습니다.
-
챕터 시작 이벤트가 발생하는 시점을 식별하고, 챕터 정보를 사용하여
ChapterObject
인스턴스를 작성합니다.ChapterObject
챕터 추적 참조:note note NOTE 다음 변수는 챕터를 추적하려는 경우에만 필요합니다. table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 3-align-center 7-align-center 11-align-center 15-align-center 19-align-center 변수 이름 설명 필수 여부 name
챕터 이름 예 position
챕터 위치 예 length
챕터 길이 예 startTime
챕터 시작 시간 예 챕터 개체:
code language-none id chapterObject = [ADBMediaHeartbeat createChapterObjectWithName:[CHAPTER_NAME] position:[POSITION] length:[LENGTH] startTime:[START_TIME]];
-
챕터에 대한 사용자 지정 메타데이터를 포함하는 경우 메타데이터에 대한 컨텍스트 데이터 변수를 작성합니다.
code language-none NSMutableDictionary *chapterDictionary = [[NSMutableDictionary alloc] init]; [chapterDictionary setObject:@"Sample segment type" forKey:@"segmentType"]; [chapterDictionary setObject:@"Sample segment name" forKey:@"segmentName"]; [chapterDictionary setObject:@"Sample segment info" forKey:@"segmentInfo"];
-
챕터 재생 추적을 시작하려면
ChapterStart
인스턴스에서MediaHeartbeat
이벤트를 호출합니다.code language-none - (void)onChapterStart:(NSNotification *)notification { [_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventChapterStart mediaObject:chapterObject data:chapterDictionary]; }
-
재생이 챕터 종료 경계에 도달하면 사용자 지정 코드에서 정의한 대로 인스턴스에서
ChapterComplete
이벤트를 호출합니다.MediaHeartbeat
code language-none - (void)onChapterComplete:(NSNotification *)notification { [_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventChapterComplete mediaObject:nil data:nil]; }
-
사용자가 챕터를 건너뛰도록 선택했기 때문에(예: 사용자가 챕터 경계를 찾는 경우) 챕터 재생이 완료되지 않은 경우 MediaHeartbeat 인스턴스에서
ChapterSkip
이벤트를 호출합니다.code language-none - (void)onChapterSkip:(NSNotification *)notification { [_mediaHeartbeat trackEvent:ADBMediaHeartbeatEventChapterSkip mediaObject:nil data:nil]; }
-
추가 챕터가 있는 경우 1~5단계를 반복합니다.
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb