{"id":41467566,"url":"https://github.com/testpress/react-native-tpstreams","last_synced_at":"2026-01-23T16:34:21.043Z","repository":{"id":296147168,"uuid":"991965107","full_name":"testpress/react-native-tpstreams","owner":"testpress","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-21T10:25:03.000Z","size":1797,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-21T22:01:47.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-28T12:16:18.000Z","updated_at":"2026-01-13T10:14:21.000Z","dependencies_parsed_at":"2025-06-24T11:21:03.157Z","dependency_job_id":"7bc5e5ad-e8b9-4d75-b47c-64d48725c60d","html_url":"https://github.com/testpress/react-native-tpstreams","commit_stats":null,"previous_names":["testpress/react-native-tpstreams"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/testpress/react-native-tpstreams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Freact-native-tpstreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Freact-native-tpstreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Freact-native-tpstreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Freact-native-tpstreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testpress","download_url":"https://codeload.github.com/testpress/react-native-tpstreams/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2Freact-native-tpstreams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28695553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T15:57:05.722Z","status":"ssl_error","status_checked_at":"2026-01-23T15:56:27.656Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-23T16:34:20.355Z","updated_at":"2026-01-23T16:34:21.031Z","avatar_url":"https://github.com/testpress.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-tpstreams\n[![npm version](https://img.shields.io/npm/v/react-native-tpstreams.svg?style=flat-square)](https://www.npmjs.com/package/react-native-tpstreams)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-tpstreams.svg?style=flat-square)](https://www.npmjs.com/package/react-native-tpstreams)\n[![license](https://img.shields.io/npm/l/react-native-tpstreams.svg?style=flat-square)](LICENSE)\n\n\nA React Native video player component for TPStreams with offline download support.\n\n## Installation\n\n```bash\nnpm install react-native-tpstreams\n```\n\n## Quick Start\n\n### 1. Initialize TPStreams\n\n```js\nimport { TPStreams } from \"react-native-tpstreams\";\n\n// Initialize once at your app's entry point\nTPStreams.initialize('YOUR_ORGANIZATION_ID');\n```\n\n### 2. Add Player Component\n\n```js\nimport { TPStreamsPlayerView } from \"react-native-tpstreams\";\n\n\u003cTPStreamsPlayerView \n  videoId=\"YOUR_VIDEO_ID\"\n  accessToken=\"YOUR_ACCESS_TOKEN\"\n  style={{ width: '100%', height: 300 }}\n/\u003e\n```\n\n## API Reference\n\n### Player Props\n\n| Prop | Type | Required | Description |\n|------|------|----------|-------------|\n| `videoId` | `string` | Yes | Video ID to play |\n| `accessToken` | `string` | Yes | Access token for the video |\n| `shouldAutoPlay` | `boolean` | No | Auto-play on load (default: true) |\n| `startAt` | `number` | No | Start position in seconds (default: 0) |\n| `enableDownload` | `boolean` | No | Enable download functionality (default: false) |\n| `offlineLicenseExpireTime` | `number` | No | License expiration in seconds (default: 15 days) |\n| `showDefaultCaptions` | `boolean` | No | Show captions if available (default: false) |\n| `startInFullscreen` | `boolean` | No | Start the player in fullscreen mode (default: false) |\n| `downloadMetadata` | `object` | No | Custom metadata for downloads |\n\n### Player Methods\n\n```js\nimport { useRef } from 'react';\nimport type { TPStreamsPlayerRef } from 'react-native-tpstreams';\n\nconst playerRef = useRef\u003cTPStreamsPlayerRef\u003e(null);\n\n// Control playback\nplayerRef.current?.play();\nplayerRef.current?.pause();\nplayerRef.current?.seekTo(30000); // 30 seconds\nplayerRef.current?.setPlaybackSpeed(2.0);\n\n// Get player state (inside an async function)\nconst getPlayerState = async () =\u003e {\n  const position = await playerRef.current?.getCurrentPosition();\n  const duration = await playerRef.current?.getDuration();\n  const isPlaying = await playerRef.current?.isPlaying();\n  const speed = await playerRef.current?.getPlaybackSpeed();\n  \n  return { position, duration, isPlaying, speed };\n};\n```\n\n### Player Events\n\n```js\n\u003cTPStreamsPlayerView\n  onPlayerStateChanged={(state) =\u003e console.log('State:', state)}\n  onIsPlayingChanged={(isPlaying) =\u003e console.log('Playing:', isPlaying)}\n  onPlaybackSpeedChanged={(speed) =\u003e console.log('Speed:', speed)}\n  onIsLoadingChanged={(isLoading) =\u003e console.log('Loading:', isLoading)}\n  onError={(error) =\u003e console.error('Error:', error)}\n  onAccessTokenExpired={(videoId, callback) =\u003e {\n    // Fetch new token and call callback(newToken)\n  }}\n/\u003e\n```\n\n## Downloads\n\n### Download Management\n\n```js\nimport {\n  pauseDownload,\n  resumeDownload,\n  removeDownload,\n  getAllDownloads,\n  isDownloaded,\n  isDownloading,\n  getDownloadStatus,\n} from 'react-native-tpstreams';\n\n// Check download status\nconst checkDownloadStatus = async (videoId) =\u003e {\n  const downloaded = await isDownloaded(videoId);\n  const downloading = await isDownloading(videoId);\n  const status = await getDownloadStatus(videoId);\n  \n  return { downloaded, downloading, status };\n};\n\n// Manage downloads\nconst manageDownload = async (videoId, action) =\u003e {\n  switch (action) {\n    case 'pause':\n      await pauseDownload(videoId);\n      break;\n    case 'resume':\n      await resumeDownload(videoId);\n      break;\n    case 'remove':\n      await removeDownload(videoId);\n      break;\n  }\n};\n\n// Get all downloads\nconst getAllDownloadedVideos = async () =\u003e {\n  const downloads = await getAllDownloads();\n  return downloads;\n};\n```\n\n### Real-time Progress\n\n```js\nimport {\n  addDownloadProgressListener,\n  removeDownloadProgressListener,\n  onDownloadProgressChanged,\n} from 'react-native-tpstreams';\n\n// Start listening\nasync function startListening() {\n  await addDownloadProgressListener();\n}\n\n// Listen for updates\nconst subscription = onDownloadProgressChanged((downloads) =\u003e {\n  console.log('Download progress:', downloads);\n});\n\n// Cleanup\nasync function cleanup() {\n  subscription.remove();\n  await removeDownloadProgressListener();\n}\n```\n\n## Resources\n\n- **Sample App**: [Complete working example](https://github.com/testpress/sample_RN_App)\n- **Documentation**: [TPStreams Developer Docs](https://developer.tpstreams.com/docs/mobile-sdk/react-native-sdk)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Freact-native-tpstreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestpress%2Freact-native-tpstreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Freact-native-tpstreams/lists"}