{"id":20762021,"url":"https://github.com/donkeyclip/motorcortex-subtitles","last_synced_at":"2025-04-30T06:29:12.806Z","repository":{"id":37210556,"uuid":"303958016","full_name":"donkeyclip/motorcortex-subtitles","owner":"donkeyclip","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-27T19:37:02.000Z","size":9727,"stargazers_count":0,"open_issues_count":19,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-28T22:45:50.847Z","etag":null,"topics":["motorcortex","motorcortex-plugin","subtitles"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/donkeyclip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-10-14T08:56:32.000Z","updated_at":"2022-04-01T08:50:01.000Z","dependencies_parsed_at":"2023-02-14T18:01:29.627Z","dependency_job_id":"22c00fc1-429a-436e-9d54-c713327f489f","html_url":"https://github.com/donkeyclip/motorcortex-subtitles","commit_stats":{"total_commits":639,"total_committers":11,"mean_commits":58.09090909090909,"dds":0.4460093896713615,"last_synced_commit":"773f4be7247a60cc966420653b7fb4ba0e835854"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-subtitles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-subtitles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-subtitles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donkeyclip%2Fmotorcortex-subtitles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donkeyclip","download_url":"https://codeload.github.com/donkeyclip/motorcortex-subtitles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225026492,"owners_count":17409241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["motorcortex","motorcortex-plugin","subtitles"],"created_at":"2024-11-17T10:28:42.017Z","updated_at":"2024-11-17T10:28:42.488Z","avatar_url":"https://github.com/donkeyclip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MotorCortex-Subtitles\n\n**Table of Contents**\n\n- [MotorCortex-Subtitles](#motorcortex-subtitles)\n  - [Demo](#demo)\n- [Intro / Features](#intro--features)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Importing and Loading](#importing-and-loading)\n- [Creating Incidents](#creating-incidents)\n  - [ParseText](#parsetext)\n- [Adding Incidents in your clip](#adding-incidents-in-your-clip)\n- [Contributing](#contributing)\n- [License](#license)\n- [Sponsored by](#sponsored-by)\n\n## Demo\n\n[Check it out here](https://donkeyclip.github.io/motorcortex-subtitles/demo/)\n\n# Intro / Features\n\nMotorCortex Subtitles takes the capabilities of the [parseSRT](https://www.npmjs.com/package/parse-srt) library for parsing subtitle files. \nThe `ParseText` Incident can parse supported subtitle files and add them to your clip. The duration is auto-calculated from your subtitles. \n\nThis Plugin exposes just one Incident:\n- ParseText\n\n## Subtitle Formats supported\nSRT\n\n# Getting Started\n## Installation\n```bash\n$ npm install @donkeyclip/motorcortex-subtitles\n# OR\n$ yarn add @donkeyclip/motorcortex-subtitles\n```\n\n## Importing and loading\n```javascript\nimport { loadPlugin } from \"@donkeyclip/motorcortex/\";\nimport SubtitleDef from \"@donkeyclip/motorcortex-subtitles\";\nconst SubtitlePlugin = loadPlugin(SubtitleDef);\n```\n\n# Creating Incidents\n\n## ParseText\n```javascript\nconst clip = new HTMLClip({\n  html: `\n    \u003cdiv class=\"container\"\u003e\u003c/div\u003e`,\n  css: `\n  .container{\n    width:100%;\n    height:100%;\n    position:relative;\n    background:#151515;\n  }\n`,\n  host: document.getElementById(\"clip\"),\n  containerParams: {\n    width: \"720px\",\n    height: \"640px\",\n  },\n});\n\nconst subtitle = new Subtitles.ParseText(\n  {\n    fontSize: 14,\n    textColor: \"white\",\n    fontFamily: \"Ubuntu\",\n    subtitles: mySubsTextFile,\n    position: \"bottom\",\n    maxWidth: 400,\n    paddingBottom: 50,\n  },\n  {\n    selector: \".container\",\n    containerParams: {\n      width: \"720px\",\n      height: \"640px\",\n    },\n  }\n);\n```\n### ParseText Attrs\n| Name | Description | Default | Type |\n| --------- |:-----------| :----| ------: |\n| fontSize | Font size in pixels of the subtitles | 12 | number |\n| textColor | The color of the subtitles | white | - |\n| fontFamily | Font family of the subtiltes | 'Ubuntu' | string |\n| subtitles | The subtitles loaded text | - | string |\n| position | Position of the subtitles container [top, center, bottom] | bottom | string |\n| maxWidth | The maximum width of the subtitles container in pixels | \"100%\" | number |\n| paddingTop | The padding top value of the subtitles container in pixels | 0 | number |\n| paddingBottom | The padding bottom value of the subtitles container in pixels | 0 | number |\n\n#### IMPORTANT \nThe container params of the subtitles clip should be the same as the parent clip.\n\n# Adding Incidents in your clip\n\n```javascript\nclipName.addIncident(incidentName,startTime);\n```\n\n### Contributing \n\nIn general, we follow the \"fork-and-pull\" Git workflow, so if you want to submit patches and additions you should follow the next steps:\n1.\t**Fork** the repo on GitHub\n2.\t**Clone** the project to your own machine\n3.\t**Commit** changes to your own branch\n4.\t**Push** your work back up to your fork\n5.\tSubmit a **Pull request** so that we can review your changes\n\n# License\n\n[MIT License](https://opensource.org/licenses/MIT)\n\n# Sponsored by\n[\u003cimg src=\"https://presskit.donkeyclip.com/logos/donkey%20clip%20logo.svg\" width=250\u003e\u003c/img\u003e](https://donkeyclip.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkeyclip%2Fmotorcortex-subtitles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonkeyclip%2Fmotorcortex-subtitles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonkeyclip%2Fmotorcortex-subtitles/lists"}