Class: Wave::Chapters

Inherits:
Object
  • Object
show all
Defined in:
lib/wave/chapters.rb

Overview

Chapters — AI chapter detection and video segmentation

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Chapters

Returns a new instance of Chapters.



6
7
8
# File 'lib/wave/chapters.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#create(video_id, body) ⇒ Object

Create a chapter (operationId: createChapter, POST /videos/videoId/chapters).



16
17
18
# File 'lib/wave/chapters.rb', line 16

def create(video_id, body)
  @client.request("POST", "/videos/#{video_id}/chapters", body: body)
end

#detect(video_id, body) ⇒ Object

Start AI chapter detection (operationId: detectChapters, POST /videos/videoId/chapters/detect).



21
22
23
# File 'lib/wave/chapters.rb', line 21

def detect(video_id, body)
  @client.request("POST", "/videos/#{video_id}/chapters/detect", body: body)
end

#list(video_id) ⇒ Object

List chapters for a video (operationId: listChapters, GET /videos/videoId/chapters).



11
12
13
# File 'lib/wave/chapters.rb', line 11

def list(video_id)
  @client.request("GET", "/videos/#{video_id}/chapters")
end