LiSA Social Commerce
Developers
Developers
  • Developers
  • Guides
    • Integration Guide
      • Web Integration
      • App Integration
        • Android
          • Communication
          • Storage
          • File Downloads
          • Theming
        • iOS
          • Communication
          • Storage
          • File Downloads
          • Theming
        • React Native
          • Communication
          • Storage
          • File Downloads
          • Theming
        • Picture in Picture
      • Entrypoints
        • Query Parameter (v1)
    • Player Communication
      • Message API Reference
        • App
          • App — Heartbeat
          • App — Message Acknowledge
          • App — Message Error
          • App — Listen
        • CTA
          • CTA — Link in Comments
          • CTA — Sponsor Badge
        • Cart — View Cart
        • Comments — Join
        • Media
          • Media — Complete
          • Media — Pause
          • Media — Progress
          • Media — Resume
        • Media Item
          • Media Item — Emoji
          • Media Item — Impression
        • Player
          • Player — Dismiss
          • Player — Native Picture-in-Picture (PiP)
          • Player — Pass Visual Viewport
          • Player — Request Visual Viewport
          • Player — UI Transition
        • Products
          • Products — Add to Cart
          • Products — Add to Wishlist
          • Products — Click
          • Products — Close Product List
          • Products — Emoji
          • Products — Emoji State Update
          • Products — Impression
          • Products — Open Product List
        • Stickers
          • Stickers — Activate
          • Stickers — Click
          • Stickers — Expire
          • Stickers — Impression
          • Stickers — Publish
          • Stickers — Unlock
          • Stickers — Unpublish
          • Stickers — Update
          • Stickers — Voucher Claim
        • Visitor — Pass User Context
        • Shared Legacy Message Properties
    • Products
      • Product Update Notification API
  • Widgets
    • Content Hub
    • Quick Start Guide
    • Configuration options
      • Autoplay
      • Channel
      • Client
      • Data
      • Debug
      • Host node
      • Layout
      • Language
      • On
      • Player
      • Query string
      • Quick view
      • Sections
      • Store
      • Template
    • API reference
      • Library API reference
      • Player API reference
      • Quick View API reference
    • Promo Widget
      • Quick Start Guide
      • Configuration options
        • Autoplay
        • Channel
        • Countdown (deprecated)
        • Enabled
        • Image modifier
        • Lead time
        • Live (deprecated)
        • Position
        • Replay (deprecated)
        • Show ID
        • URL
  • Media Player Introduction
    • Picture-in-Picture Mode
  • Analytics
  • REST API
    • Authentication
    • Rate limits
    • Response status and error codes
    • API Documentation
Powered by GitBook
On this page
  • Visual Viewport Properties
  • Properties
  • Type Definition
  • Examples
  1. Guides
  2. Player Communication
  3. Message API Reference
  4. Player

Player — Pass Visual Viewport

PreviousPlayer — Native Picture-in-Picture (PiP)NextPlayer — Request Visual Viewport

Last updated 1 month ago

In certain situations, the LiSA Player sends a message to from the host app or environment. In response to this message, the host app / environment should pass essential properties of the current Visual Viewport back to the LiSA Player.

This message is sent by the host app / environment to the LiSA Player.

Visual Viewport Properties

const visualViewport = {
  viewportHeight: window.visualViewport.height ?? window.innerHeight,
  viewportScrollX: window.visualViewport.pageLeft ?? window.scrollX,
  viewportScrollY: window.visualViewport.pageTop ?? window.scrollY,
  viewportWidth: window.visualViewport.width ?? window.innerWidth,
};

Properties

Along with all standard , a Pass Visual Viewport message includes the following additional properties:

Name
Type
Description

messageType

Required.

lsc:player:viewport:pass

viewportHeight

Required.

The viewportHeight property represents the current height of the host app / environment's host app's visual viewport.

viewportScrollX

Required.

The viewportScrollX property represents the current horizontal scroll offset of the host app / environment's host app's visual viewport.

viewportScrollY

Required.

The viewportScrollY property represents the current vertical scroll offset of the host app / environment's host app's visual viewport.

viewportWidth

Required.

The viewportWidth property represents the current width of the host app / environment's host app's visual viewport.


Type Definition

interface PlayerPassVisualViewportMessage extends Omit<
  Message,
  'clockDriftInMs' | 'messageType' | 'recipient'
> {
  messageType: 'lsc:player:viewport:pass';
  recipient: 'LiSA';
  viewportHeight: number;
  viewportScrollX: number;
  viewportScrollY: number;
  viewportWidth: number;
}

Examples

{
  "messageType": "lsc:player:viewport:pass",
  "recipient": "LiSA",
  "sender": "Sender",
  "viewportHeight": 854,
  "viewportScrollX": 0,
  "viewportScrollY": 0,
  "viewportWidth": 480
}
Literal    
Number
Number
Number
Number
request the visual viewport
Message properties