Abilita l'embed YouTube sulle dirette e tiene la copia locale se il VOD non è incorporabile.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-28 15:05:12 +02:00
co-authored by Cursor
parent 05ef56c56d
commit 42dadb993d
6 changed files with 104 additions and 32 deletions
@@ -24,7 +24,8 @@ module Youtube
),
content_details: Google::Apis::YoutubeV3::LiveBroadcastContentDetails.new(
enable_auto_start: true,
enable_auto_stop: false
enable_auto_stop: false,
enable_embed: true
)
)
result = client.insert_live_broadcast("snippet,status,contentDetails", broadcast)
@@ -97,6 +98,24 @@ module Youtube
:skipped
end
def enable_video_embed!(video_id, privacy_status: "unlisted")
return if video_id.blank? || video_id.to_s.start_with?("mock_")
return if @credential.blank? || missing_oauth_config?
client = authorized_client
video = Google::Apis::YoutubeV3::Video.new(
id: video_id,
status: Google::Apis::YoutubeV3::VideoStatus.new(
embeddable: true,
privacy_status: privacy_status.presence || "unlisted",
self_declared_made_for_kids: false
)
)
client.update_video("status", video)
rescue Google::Apis::Error => e
raise Error, e.message
end
def complete_broadcast!(broadcast_id)
return if broadcast_id.blank?
return if @credential.blank? || missing_oauth_config?