Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
mirax-player
Advanced tools
Mirax Player is a free video player for React, Vue, Angular, and Svelte that can embed videos from platforms like TikTok, YouTube/Shorts, Twitter, Vimeo and Dailymotion.
Mirax Player is a free video player for React, Vue, Angular, and Svelte that can embed videos from platforms like TikTok, YouTube/Shorts, Twitter, Vimeo and Dailymotion. This library package enables you to set any URL once within a single embed code tag and dynamically embed videos from any video sites.
Frameworks / Library | Tested versions |
---|---|
18 & above | |
3 & above | |
16 & above | |
3 & above |
Version 6
Major changes:
Minor changes:
6.3.0
6.2.0
Patch changes:
6.3.1
Fixed the player UI issue.
Progress bar move to the top
To install the Mirax Player, you can use the following npm command:
npm install mirax-player
Logo | Sites | Source type | Docs. |
---|---|---|---|
YouTube / Shorts | Iframe Api | https://developers.google.com/youtube/iframe_api_reference | |
Vimeo | Player SDK | https://developer.vimeo.com/player/sdk | |
TikTok | oEmbed API | https://developers.tiktok.com/doc/embed-videos/ | |
Dailymotion | oEmbed API | https://developers.dailymotion.com/player/#player-oembed | |
Twitter / X | JavaScript API | https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/set-up-twitter-for-websites |
Mirax embed props | Functionality | Type | Required |
---|---|---|---|
mirax-embed | responsiveness | any | yes |
data-e-width | dynamic width | integer | yes |
data-e-height | dynamic height | integer | yes |
data-e-fullscreen | enable fullscreen | boolean | optional (true false) |
data-e-controls | enable controllers | boolean | optional (true false ) |
data-e-autoplay | enable autoplay | boolean | optional (true false) |
data-e-loop | enable loop | boolean | optional (true false) |
data-e-url | video address, url/links | any | yes |
src/react/TypeScriptPlayer.md
src/react/TypeScriptEmbed.md
src/vue/TypeScriptPlayer.md
src/vue/TypeScriptEmbed.md
src/svelte/TypeScriptPlayer.md
src/svelte/TypeScriptEmbed.md
import React, { useEffect } from "react";
import { embed } from 'mirax-player';
const ExampleComponent = () => {
useEffect(() => {
embed("mirax-embed");
}, []);
return (
<div className="mirax-embed"
data-e-width="640" // 800 x 450 or 1000 x 562.5
data-e-height="360"
data-e-autoplay="false" // for autoplay set true or remove this props
data-e-url="https://vimeo.com/217499569">
</div>
);
};
export default ExampleComponent;
<template>
<div class="mirax-embed"
data-e-width="640" // 800 x 450 or 1000 x 562.5
data-e-height="360"
data-e-autoplay="false" // for autoplay set true or remove this props
data-e-url="https://vimeo.com/217499569">
</div>
</template>
<script>
import { onMounted } from "vue";
import { embed } from 'mirax-player';
export default {
setup() {
onMounted(() => {
embed('mirax-embed');
});
return {};
}
};
</script>
import { Component, OnInit } from '@angular/core';
import { embed } from 'mirax-player';
@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css']
})
export class ExampleComponent implements OnInit {
constructor() { }
ngOnInit(): void {
embed('mirax-embed');
}
}
example.component.html
<div class="mirax-embed"
data-e-width="640"
data-e-height="360"
data-e-autoplay="false"
data-e-url="https://vimeo.com/217499569">
</div>
<script>
import { onMount } from 'svelte';
import { embed } from 'mirax-player';
onMount(() => {
embed('mirax-embed');
});
</script>
<div class="mirax-embed"
data-e-width="640" // 800 x 450 or 1000 x 562.5
data-e-height="360"
data-e-autoplay="false" // for autoplay set true or remove this props
data-e-url="https://vimeo.com/217499569">
</div>
Mirax player props | Functionality | Type | Required |
---|---|---|---|
player-selector | responsiveness | any | yes |
data-player-width | dynamic width | integer | yes |
data-player-float | dynamic alignment | string | optional |
data-player-theme | player color | any | optional |
data-player-bar | progress bar color | any | optional |
Keyboard shortcuts | Functions | Description |
---|---|---|
press space bar | Play & Pause | The video will play or pause |
press alt+p | PiP | Picture in Picture screen |
press left arrow key | rewind clip | backward for 10 sec. |
press right arrow key | advance clip | forward for 10 sec. |
location of videos stored:
public/clip.mp4 from your frameworks
assets/clip.mp4 -Angular
example.com/video/clip.mp4 (url)
import React, { useEffect, useRef } from "react";
import { miraxPlayer } from 'mirax-player';
const ExampleComponent = () => {
const playerDiv = useRef(null);
useEffect(() => {
miraxPlayer(playerDiv.current);
},[]);
return (
<div className="player-selector">
<video className="mirax-player" ref={playerDiv}
data-player-width="800"
src="clip.mp4">
</video>
</div>
);
};
export default ExampleComponent;
<template>
<div class="player-selector">
<video ref="videoPlayer"
class="mirax-player"
data-player-width="800"
src="clip.mp4">
</video>
</div>
</template>
<script>
import { ref, onMounted } from "vue";
import { miraxPlayer } from 'mirax-player';
export default {
setup() {
const videoPlayer = ref(null);
onMounted(() => {
miraxPlayer(videoPlayer.value);
});
return {
videoPlayer
};
}
};
</script>
import { Component, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { miraxPlayer } from 'mirax-player';
@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css']
})
export class ExampleComponent implements AfterViewInit {
@ViewChild('videoPlayer', { static: true }) videoPlayer!: ElementRef<HTMLVideoElement>;
ngAfterViewInit(): void {
this.initializemiraxPlayer();
}
initializemiraxPlayer() {
miraxPlayer(this.videoPlayer.nativeElement);
}
}
example.component.html
<div class="player-selector">
<video #videoPlayer
class="mirax-player"
data-player-width="800"
src="assets/clip.mp4">
</video>
</div>
<script>
import { onMount } from 'svelte';
import { miraxPlayer } from 'mirax-player';
let videoPlayer;
onMount(() => {
miraxPlayer(videoPlayer);
});
</script>
<div class="player-selector">
<video bind:this={videoPlayer} class="mirax-player"
data-player-width="800"
src="clip.mp4">
<track kind="captions" src="" label="English" default>
</video>
</div>
data-player-float="left"
data-player-float="" // center is default
//or
data-player-float="center"
data-player-float="right"
data-player-theme="rgba(250, 149, 35, 0.9)"
data-player-bar="rgba(17, 117, 59, 0.9)"
data-player-theme="rgb(0,0,0)"
data-player-bar="rgb(255, 255, 255)"
data-player-theme="#000000"
data-player-bar="#00ff00"
data-player-theme="black"
data-player-bar="red"
data-player-theme = "rgba(0, 0, 0, 0)"
Color Types | Color syntax | Example | Opacity Range | Appearance |
---|---|---|---|---|
RGBA | rgba() | rgba(255,0,0, 0.5) | 0.1 to 0.9 or 0 and 1 | Red half transparency |
RGB | rgb() | rgb(255, 0, 0) | none | Red |
HEXA | #6digits | #ff0000 | none | Red |
COLORNAME | colorname | red | none | Red |
Demjhon Silver
FAQs
A free video player compatible with React, Vue, Angular, and Svelte.
The npm package mirax-player receives a total of 152 weekly downloads. As such, mirax-player popularity was classified as not popular.
We found that mirax-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.