Socket
Socket
Sign inDemoInstall

@charisma-ai/react-comic-player-pa-mod

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@charisma-ai/react-comic-player-pa-mod

Charisma.ai React component for web stories modified for PA project.


Version published
Maintainers
5
Created
Source

React Comic Player

Charisma.ai React component for playing web stories like an interactive comic.

Screenshot of a Charisma comic, with a message bubble displaying the character's text over a full-screen image.

pnpm i @charisma-ai/react-comic-player

Integrating into your own app

There's a test app in ./test/test-app which shows how to integrate the comic player into a React app.

First, integrate @charisma-ai/react into your React app. Once that's done, you should have at least a playthroughToken, a conversationUuid, and a Playthrough component.

Then, the <ComicPlayer> needs to be linked to the same conversation, so it can display the media for the messages as they arrive.

To do this, render your <ComicPlayer> inside the same <Playthrough> component, and pass in the same conversationUuid into <ComicPlayer>:

<Playthrough {...yourPlaythroughProps}>
  <div style={{ width: 340, height: 600 }}>
    <ComicPlayer conversationUuid={conversationUuid} />
  </div>
</Playthrough>

To style the component, import the stylesheet:

import "@charisma-ai/react-comic-player/styles.css";

ComicPlayer is a responsive component, and fills 100% of the height and width of its parent container. If you wanted a full-screen player, for example, you could set the parent's height and width to 100vh and 100vw. Depending on if the comic player is in a portrait or landscape orientation, the ComicPlayer will only display media layers that are configured for that orientation.

ComicPlayer is designed to only display the media of the story. To add controls such as tapping or replying, these should be implemented outside the ComicPlayer. The useConversation hook or Conversation component can be used to link the controls to the same conversationUuid.

FAQs

Package last updated on 16 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc