player

LiG Player SDK for Android (tw.com.lig:player) renders LiG AR scenes with ARCore and Sceneform.

A host app detects a LigTag with the LiG scanner SDK, then hands the light's pose and lightId to the player. The player loads that light's scenes from the LiG cloud, downloads and caches each scene's assets, builds the scene's AR objects under a shared origin anchored to the LigTag, and runs the scene's events and actions. The host receives scene events through listeners on the shared context.

Where to start

  • LiGPlayer holds the SDK version and locale and exposes the shared SceneFormContext.

  • SceneFormContext is the entry point: set the access token, load the light's scenes, download and load one scene, attach its origin, then call visibilityCheckWith every frame and unload when done.

  • LiGCoordinateSystem turns a detected LigTag's pose into the scene origin's pose.

Requirements

  • ARCore is a compileOnly dependency; the host app declares its own ARCore dependency.

  • The Bluetooth shutter feature needs the host app to declare ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.

Packages

Link copied to clipboard
Link copied to clipboard

Global entry points. LiGPlayer holds the SDK version and locale and exposes the shared SceneFormContext. LiGCoordinateSystem turns a detected LigTag's pose into the scene origin's pose using the light's cloud calibration. WebViewBottomDialog is the in-app browser that scene actions open.

Link copied to clipboard

The runtime for scene actions. Each action entry in a scene's JSON (a wire type id plus values) becomes a BaseAction subclass, such as move, rotate, fade, scale, play an animation, video or audio, show or hide, switch scene, or open a web page. Actions run on a node event in ActionGroups: groups run one after another by values.group, and the actions inside a group run concurrently on the main thread. Action types the player does not implement go to the host app through SceneFormContext.actionListener (NonLiGAction); UiAction and PanoramaAction hand off to their own listeners.

Link copied to clipboard

The core AR runtime. SceneFormContext loads a light's scenes from the LiG cloud, downloads and caches scene assets, builds the nodes under a shared origin, and passes scene events to the host through listeners. LiGScene is one playable scene. LiGArSceneView is an ArSceneView that sends taps to selectable nodes.

Link copied to clipboard

Helpers for route finding on the navigation graph (PathFinder, Dijkstra), horizontal-distance maths, quaternion and Euler conversion, and small Android and ARCore utilities and debug formatters.

Link copied to clipboard

Indoor navigation (Navigator). It guides the user along the scene's navigation map to a named mark with an on-screen arrow and a target marker, and reports distance and arrival.

Link copied to clipboard

Data models and runtime wrappers for LiG scenes. The Gson payload classes cover the light and scene responses, scene objects, games, bot, user profile, light pose and navigation map. The runtime classes (ArObjectModel, ArEventModel, ArActionModel) turn parsed scene JSON into scene nodes, event triggers and executable actions. The enums decode the numeric model, event, action and vibration codes, and ProgressResponseBody and RetryInterceptor are the OkHttp helpers for download progress and retries.

Link copied to clipboard

Models for one AR object in a scene payload: its local position and rotation (Location), scale (Zoom), renderable (ArModel), and triggers (ArEvent, ArEventValues). The player builds nodes from these; integrators normally only read them.

The action side of triggers: ArAction and its flat ArActionValues parameter bag (move, fade, open web, switch scene, and so on), plus the cron-style PeriodParser and TriggerCondition used by periodic triggers.

Type-specific renderable settings (ModelFields: size, video, chroma key, polyhedron, snow, dashboard, visibility distance) and resource references (Texture).

Link copied to clipboard

Sceneform nodes that render the AR objects of a LiG scene. ArBaseNode is the base of every rendered object: it applies the object's transform, loads and caches its assets, wires its events to actions, and handles pinch and rotate gestures. Each subclass renders one AR object type: image planes, 3D models, video and live streams, shapes, snow, dashboards, recommendation boards and polyhedrons. The scene creates them from the scene JSON; integrators usually reach them through SceneFormContext.ligNodeMap to add listeners or control playback. The package also holds helper nodes for navigation (arrow and waypoint markers), debug origin axes and a particle emitter. Ar360BallNode, which renders 360° video, is currently declared without a package and appears in the root package.

Link copied to clipboard

Optional pairing with a Bluetooth LE shutter remote: a device-picker activity, a bound GATT service that broadcasts device events, and a scanner. Each device event becomes a tap at the centre of the AR view. The host app must declare ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.

A small 2D canvas particle engine: a view, a system, a shared particle pool and a config of randomized ranges. ArEmitterNode renders it in AR; integrators rarely use it directly.

Link copied to clipboard

Sceneform helpers that build single- or double-sided materials (color, texture, shadow, occlusion) and simple shape renderables (plane, cube, sphere, cylinder) from the SDK's bundled material sources.

Link copied to clipboard

Android views used around the AR scene: a photo view for image objects and a download-progress popup overlay.

Link copied to clipboard

Support utilities: extracting scene ZIPs and mapping their assets, an OkHttp coroutine bridge, the locale tag sent to the cloud, speech recognition with the AI chat bot and text-to-speech, AR photo capture into DCIM, and colour maths.