YouTube Live streaming integration in mobile app

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
YouTube Live streaming integration in mobile app
Medium
~5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    757
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    874
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

YouTube Live Streaming Integration from Mobile Application

YouTube Live — the most popular platform for public streaming. Integration from mobile means: get user's RTMP endpoint via YouTube Data API v3, launch stream from camera to that endpoint, and manage broadcast (start, stop, metadata) — all from your app, not YouTube Studio.

YouTube Data API v3: Getting RTMP Endpoint

Broadcasting on YouTube — two objects: LiveBroadcast (event with time, title, privacy settings) and LiveStream (technical stream with RTMP endpoint and stream key). They link via bind.

API call sequence:

1. Authorization. OAuth 2.0 scope: https://www.googleapis.com/auth/youtube. iOS: AppAuth library or ASWebAuthenticationSession. Android: Google Sign-In SDK or AppAuth-Android.

2. Create LiveBroadcast:

POST https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet,status,contentDetails
{
  "snippet": {
    "title": "My Broadcast",
    "scheduledStartTime": "2025-03-28T12:00:00Z"
  },
  "status": { "privacyStatus": "public" },
  "contentDetails": { "enableAutoStart": true, "enableAutoStop": true }
}

enableAutoStart: true — broadcast starts automatically when video stream arrives. Without it need separate transition API call.

3. Create LiveStream:

POST https://www.googleapis.com/youtube/v3/liveStreams?part=snippet,cdn
{
  "snippet": { "title": "Mobile Stream" },
  "cdn": {
    "frameRate": "30fps",
    "ingestionType": "rtmp",
    "resolution": "1080p"
  }
}

Response contains ingestionInfo.ingestionAddress (RTMP URL) and ingestionInfo.streamName (stream key).

4. Bind:

POST .../liveBroadcasts/bind?id={broadcastId}&part=id,snippet&streamId={streamId}

Total: rtmp://{ingestionAddress}/{streamName} — full RTMP URL for streaming.

Streaming to Obtained Endpoint

Use HaishinKit (iOS) or rtmp-rtsp-stream-client-java (Android) — as in standard RTMP streaming. YouTube accepts H.264 + AAC.

YouTube stream requirements:

  • Video: H.264, baseline/main/high profile, up to 1080p60
  • Audio: AAC-LC, 44.1 or 48 kHz, up to 256 kbps
  • Max bitrate for 1080p30: ~6 Mbps
  • GOP (keyframe interval): 2 seconds max — important, else YouTube rejects stream

kVTCompressionPropertyKey_MaxKeyFrameInterval: 60 (for 30 fps = keyframe every 2 seconds) on iOS. Android: format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 2).

YouTube doesn't accept RTMPS (TLS) on rtmps:// — only rtmp://. Important when setting network requests on iOS (ATS requires HTTPS, but RTMP not HTTP — write exception in Info.plist for domain a.rtmps.youtube.com only if using RTMPS endpoint).

Managing Broadcast via API

Check stream status:

GET .../liveStreams?part=status&id={streamId}

status.streamStatus: inactivetestingactive. After active broadcast visible to viewers (with enableAutoStart: true).

End broadcast:

POST .../liveBroadcasts/transition?broadcastStatus=complete&id={broadcastId}&part=id,status

Update metadata during broadcast (title, description):

PUT .../liveBroadcasts?part=snippet

Poll status: request every 5 seconds while streamStatus != active. Not more often — YouTube API quota 10000 units/day, liveStreams.list costs 1 unit.

Broadcast Preview in App

YouTube provides monitorStream.embedHtml — embed URL of broadcast. Embed via WKWebView / WebView to view delayed stream (YouTube adds 5–20 seconds delay). To view yourself without delay — use camera preview locally.

Viewer count: GET .../videos?part=liveStreamingDetails&id={broadcastId}liveStreamingDetails.concurrentViewers. Request every 30 seconds during broadcast.

Quotas and Limits

YouTube Data API quota: 10,000 units/day free. Creating LiveBroadcast — 50 units. Creating LiveStream — 50 units. Polling liveStreams.list — 1 unit/request. With active use (many broadcasts daily) need to request quota increase in Google Cloud Console.

YouTube prohibits 5+ simultaneous active broadcasts per account. For SaaS platform with many users — each works with own account (OAuth on behalf of user), not app.

Timeline: integrate OAuth + create broadcast via API + launch RTMP stream + manage status — 3–4 work days.