titli_video_sdk 0.2.0
titli_video_sdk: ^0.2.0 copied to clipboard
Titli Video SDK for Flutter. Metered 1:1 audio and video calls, Live Hosts, live stream viewing and gifts in your app.
Changelog #
0.2.0 #
-
Quick mode: the whole client side with only a publishable App Key, no backend.
TitliVideo.init(appKey:, userId:, userName:, apiBase:, deviceId:),TitliVideo.setUser(userId, [userName]),TitliVideo.startCall(type:)(create + join as the payer) andTitliVideo.joinCall(callId, role:), both returning a connectedTitliCall. NamespacesTitliVideo.calls,TitliVideo.liveHosts(startCallconnects),TitliVideo.liveStreams(watchconnects as a viewer),TitliVideo.gifts, andTitliVideo.config(). Requests go to/v1/client/*with theX-Titli-*headers (App Key, user, platform, package name / bundle ID, Android signing certificate, device id, SDK version) and never anAuthorizationheader; on web the browser'sOriginreplacesX-Titli-App. 429 waitsRetry-After, 5xx and no answer back off 1 s / 2 s / 4 s, other 4xx are never repeated. -
TitliVideoError(errorCode,userCode,userMessage,userMessageHi,userMessageFor,message,httpStatus,retryAfter,docsUrl,details) for every Quick-mode failure, including the new codesAPP_KEY_INVALID,QUICK_MODE_OFF,APP_NOT_ALLOWED,QUICK_DAILY_CAP_REACHED,END_USER_DAILY_LIMIT. -
TitliCallType(audio,video) andTitliRole(user,host). -
TitliCall.callId, andTitliCall.connect(callId:)to keep your own. -
The gift sheet works in Quick mode without a send handler: the SDK loads the gift list, sends through
/v1/client/live-hosts/calls/{id}/giftsor/v1/client/live-streams/{ref}/giftswith aclient_request_id, and reloads the list aftergift_unavailable/gift_price_changed. -
New dependencies:
httpandweb(already used bylivekit_client) andpackage_info_plus(package name / bundle ID and the Android signing certificate for Quick mode). -
The example runs in Quick mode by default (
--dart-define=TITLI_APP_KEY=… TITLI_USER_ID=… [TITLI_API_BASE=…] [TITLI_CALL_ID=…]), keeps Secure mode as a tab, and builds for web. -
Viewer mode for Live Streamers Pool:
TitliCall.connectwith a viewer token (ormode: TitliCallMode.viewer) publishes nothing and needs no permission. Live events (onLiveEvent,liveEventsstream, sealedTitliLiveEvent) and notifiersliveHost,liveViewers,liveHostAway,liveChat,liveEnd. Leaves 3 s afterended/kicked. -
TitliCallScreenshows the viewer layout (host video, watermark, chat, gift toasts, host-away banner, viewer count, leave, end message) withonLiveEventandliveStrings. Call mode is unchanged. -
Gifts for Live Hosts calls and Live Streams (2026-11-28).
call.gifts(TitliGifts):setCatalogwith the gift list your backend relays fromGET /v1/gifts,onSendGift(your backend call),send(gift, count:)with a UUIDclient_request_idthat is reused only while the outcome of that send is not known (no answer, 429, a 5xx withoutrefunded, orpending),enabled,canSend,gifts,needsReload. ModelsTitliGift,TitliGiftCatalog,TitliGiftRequest; typedTitliGiftError/TitliGiftErrorCodewith the ready-to-showuserMessage(userMessageHianduserMessageFor(languageCode)for Hindi; the gift sheet uses your app's locale). -
TitliCallScreenshows a gift button and a gift sheet (icon, name, price, count, Send) in calls and lives when a gift list withenabled: trueand anonSendGifthandler are given (giftCatalog,onSendGift,giftStrings). Nothing shows otherwise. -
Gifts, after the first review (2026-11-28):
sendrefuses withgiftNotInSessiononce the call or live has ended; an error withrefunded: trueis final and apendingresult keeps itsclient_request_id(pendingRequest,clearPending(),confirmDelivered(),TitliGifts.isPendingResult);retryableis also true for 5xx /partner_unavailablewithoutrefunded.applyBrief/isStalefor the short{ enabled, version }object, which no longer empties the list insetCatalog.maxCountis read from the list (max_count, 99 without it; the staticTitliGifts.maxCountbecame the instance getter,TitliGifts.defaultMaxCountis 99).TitliGiftErrorCode.partnerUnavailable(serviceUnavailablestays as an alias),TitliGiftError.legacyCode. USD prices show up to 6 decimals, never fewer than 2; INR up to 4. -
TitliCallScreen: the gift sheet closes when the call or live ends, beforeonEnded;onGiftsReloadNeeded; the sheet shows the new price aftergift_price_changed; its busy state is the controller's; gift props that change on a rebuild are applied after the frame. -
TitliLiveGift.coinsis no longer read from live events: always 0, deprecated. -
The
giftlive event now also arrives in 1:1 calls (onLiveEvent,call.liveEvents) for each gift the user sent, so the app can play the animation.TitliLiveGiftgainsanimationUrl,TitliLiveSendergainsendUserId. -
Fixed: live events are read in the form the server sends them (
gift_id,icon_url,animation_url, andcounton theviewersevent). Before, a gift's id and icon and the viewer count stayed empty. -
Deprecated:
TitliLiveGift.coins(always 0 for new gifts; it is not part of the gift model).
0.1.0 #
- First release:
TitliCall.connect, microphone and camera controls, camera switch, end reasons, and the prebuiltTitliCallScreenfor audio and video calls.