Kinora Player Wrapper

Wrap your Livepeer Players.

Wrap each Livepeer Player Component in your App with the Kinora Player Wrapper for seamless videometric logging.

The Kinora Player Wrapper performs two core functions:

  1. Metric Logging: For crafting personalized video feeds and documenting Player Quest Milestone progression.

  2. Refined Control: For Livepeer Player style customization and direct video element interaction via callback props and instance methods.

circle-exclamation
import { Player } from "@livepeer/react";
import { KinoraPlayerWrapper } from "kinora-sdk";

function Page() {

return (
  <div id="uniqueParentId" className="w-20 h-20 flex">
    <KinoraPlayerWrapper
      parentId={"uniqueParentId"}
      postId={postId}
      customControls={true}
      fillWidthHeight={true}
      >
      {(setMediaElement: (node: HTMLVideoElement) => void) => (
        <Player
         mediaElementRef={setMediaElement}
         playbackId="f5eese9wwl88k4g8"
         objectFit="cover"
         />
       )}
    </KinoraPlayerWrapper>
   </div>
  );
}

Metric Logging

To initiate the logging of player interactions for each unique playback Id played by your Livepeer Player Components, ensure to pass in the postId that the video is linked to (i.e. the post Id of the video on Lens). Metrics will not be logged if this prop is not provided.

Refer to the Send Metrics On-Chain section for comprehensive instructions on accurately receiving and sending the transmission of logged player metrics on-chain.

Refined Control

All generic Video HTML Element callback props and instance methods are readily configurable and accessible via the wrapper, enabling comprehensive style customization for controls, aspect ratio and general CSS styling of the Livepeer Player component.

If you possess the publication Id of a Lens Post associated with the playback Id, this prop can also be passed in along with the user's profile Id to simultaneously retrieve and display publication data related to the video.

Kinora Player Wrapper Props

Last updated