https://github.com/negat1v9/tgs-player
TGS file player for your website
https://github.com/negat1v9/tgs-player
telegram-mini-app tgs tma
Last synced: 26 days ago
JSON representation
TGS file player for your website
- Host: GitHub
- URL: https://github.com/negat1v9/tgs-player
- Owner: Negat1v9
- Created: 2025-03-24T21:53:28.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2025-03-24T21:54:21.000Z (about 1 month ago)
- Last Synced: 2025-03-24T22:29:40.308Z (about 1 month ago)
- Topics: telegram-mini-app, tgs, tma
- Language: JavaScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
# TGS Player Web Component
A lightweight web component for playing Telegram Sticker animations (*.tgs files) in web browsers using WebAssembly technology.### Features
- Extremely small footprint (~30KB for the core WebAssembly module)
- Hardware-accelerated rendering using WebAssembly
- Support for Telegram's TGS (Lottie) animation format
- Simple API with declarative usage
- Customizable playback controls### Installation
1. Add the `/js` folder to the root of your project or to an existing directory
2. Include the component in your HTML:
```html```
### Usage
Basic implementation:
```html```
### Attributes
| Attribute | Description |
|---------|----------|
| `src` | Path to .tgs file (required) |
| `once` | Play animation only once |
| `onclick` | Enable click-to-play functionality |
| `autoplay` | Start animation automatically |### Examples
### Basic Usage:
```html```
### Click-to-Play Animation:
```html```
### One-time Autoplay:
```html```
### Technical Details
- Uses WebAssembly for high-performance animation rendering
- Optimized for modern browsers
- No external dependencies required
- Efficient memory management through WebAssembly### Browser Support
Supports all modern browsers with WebAssembly capabilities:- Chrome (v57+)
- Firefox (v52+)
- Safari (v11+)
- Edge (v79+)### Performance
- Minimal CPU usage due to WebAssembly optimization
- Small memory footprint
- Hardware acceleration when available
- Efficient animation caching system### Source code
Some of the code is taken from the demo mini application [durgerKing](https://t.me/DurgerKingBot) which was created by the team telegarm to demonstrate the capabilities of TMA