Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mirax-player
Advanced tools
Mirax Player is a powerful free video player for React, Vue, Angular, and Svelte that can embed videos from platforms like TikTok, YouTube/Shorts, and Vimeo.
Disclaimer: This image is based on an example TikTok embedded video clip.
Mirax Player is a powerful free video player for React, Vue, Angular, and Svelte that can embed videos from platforms like TikTok, YouTube/Shorts, and Vimeo. This library package enables you to set any URL once within a single embed code tag and dynamically embed videos from any video sites. It was written in pure JavaScript but can be implemented in both TypeScript and JavaScript.
Major:
Adding speed control options:
Fullscreen will be exact mirax-player ui
Adding new mirax player tag:
`mirax-player-class`
`data-mirax-player-width`
`data-mirax-player-float`
`data-mirax-player-theme`
`data-mirax-player-bar`
Adding new mirax embed tag:
`data-mirax-fullscreen`
`data-mirax-controls`
Minor:
Patches:
Bugs Fixed:
Copy link
To install the Mirax Player, you can use the following npm command:
npm install mirax-player
Sites | Source type | Add-on Params | Links |
---|---|---|---|
YouTube / Shorts | Iframe Api | https://developers.google.com/youtube/player_parameters | https://developers.google.com/youtube/iframe_api_reference |
Vimeo | Player SDK | https://developer.vimeo.com/player/sdk/embed | https://developer.vimeo.com/player/sdk |
TikTok | oEmbed API | https://developers.tiktok.com/doc/embed-videos/ | https://developers.tiktok.com/doc/overview/ |
Thanks to these documentations of YouTube, Vimeo, and TikTok, I was able to integrate their APIs seamlessly into this library package. 😆 👏
Mirax embed tags | Type | Functionality | TikTok | YouTube | Vimeo |
---|---|---|---|---|---|
mirax-embed-class | class name | responsiveness | required | required | required |
data-mirax-width | attribute | dynamic width | n/a | required | required |
data-mirax-height | attribute | dynamic height | n/a | required | required |
data-mirax-fullscreen | attribute | enable fullscreen | n/a | required | n/a |
data-mirax-controls | attribute | enable controllers | n/a | required | required |
data-mirax-embed | attribute | video links to embed | required | required | required |
example:
<div className="mirax-embed-class">
<div ref={embedVideo}
data-mirax-width="640" // You can set any value, such as 800x450, to make it larger.
data-mirax-height="360" //
data-mirax-fullscreen="true" // boolean only true or false
data-mirax-controls="true" // boolean only true or false
data-mirax-embed="https://vimeo.com/217499569" // links from TikTok Youtube/Shorts and Vimeo
>
</div>
</div>
Mirax player tags | Type | Functionality | Min | Max | Example value |
---|---|---|---|---|---|
mirax-player-class | class name | responsiveness | n/a | n/a | n/a |
data-mirax-player-width | attribute | width | 360 | 800 | 640 |
data-mirax-player-float | attribute | float position | n/a | n/a | left, center, right |
data-mirax-player-theme | attribute | player color | n/a | n/a | red, green |
data-mirax-player-bar | attribute | progress bar color | n/a | n/a | blue, yellow |
Keyboard keys / buttons | Functions | Description | Supported Browsers |
---|---|---|---|
press space bar | Play & Pause | The video will play or pause | All browsers |
click ▶ | Play & Pause | The video will play or pause | All browsers |
press alt+p | PiP | Picture in Picture screen | !firefox but auto appear PiP icon |
click Γ | PiP | Picture in Picture screen | All browsers |
double click the video | Fullscreen | It will set as fullscreen mode | All browsers |
click ❐ | Fullscreen | It will set as fullscreen mode | All browsers |
swipe for volume | Volume | To adjust the volume level | All browsers |
scroll up/down speaker icon | Volume | To adjust the volume level | All browsers |
swipe for time frame | Progress bar | To adjust video frame timestamp | All browsers |
scroll up/down | Progress bar | backward/forward | All browsers |
press left arrow key | Progress bar | backward for 10 sec. | All browsers |
press right arrow key | Progress bar | forward for 10 sec. | All browsers |
input:
src=" "
video stored location:
public/clip.mp4 from your frameworks
assets/clip.mp4 angular
example.com/video/clip.mp4
import React, { useEffect, useRef } from "react";
import { miraxplayer } from 'mirax-player';
const ExampleComponent = () => {
const videoPlayer = useRef(null);
useEffect(() => {
if (videoPlayer.current) {
miraxplayer(videoPlayer.current);
}
});
return (
<div className="mirax-player-class">
<video ref={videoPlayer}
className="mirax-player"
data-mirax-player-width="800"
data-mirax-player-float=" "
data-mirax-player-theme=" "
data-mirax-player-bar=" "
src="clip.mp4"></video>
</div>
);
};
export default ExampleComponent;
import React, { useEffect, useRef } from "react";
import { miraxEmbed } from 'mirax-player';
const ExampleComponent = () => {
const embedVideo = useRef(null);
const youtubeParams = {
playerVars: {
cc_load_policy: 1
}
};
const vimeoParams = {
responsive: true
};
useEffect(() => {
miraxEmbed(embedVideo.current, youtubeParams, vimeoParams);
});
return (
<div className="mirax-embed-class">
<div ref={embedVideo}
data-mirax-width="640"
data-mirax-height="360"
data-mirax-fullscreen="true"
data-mirax-controls="true"
data-mirax-embed="https://vimeo.com/217499569">
</div>
</div>
);
};
export default ExampleComponent;
src/react/TypeScriptPlayer.md
src/react/TypeScriptEmbed.md
<template>
<div class="mirax-player-class">
<video ref="videoPlayer"
class="mirax-player"
data-mirax-player-width="800"
data-mirax-player-float=" "
data-mirax-player-theme=" "
data-mirax-player-bar=" "
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(() => {
if (videoPlayer.value) {
miraxplayer(videoPlayer.value);
}
});
return {
videoPlayer
};
}
};
</script>
<template>
<div class="mirax-embed-class">
<div ref="embedVideo"
data-mirax-width="640"
data-mirax-height="360"
data-mirax-fullscreen="true"
data-mirax-controls="true"
data-mirax-embed="https://vimeo.com/217499569">
</div>
</div>
</template>
<script>
import { ref, onMounted } from "vue";
import { miraxEmbed } from 'mirax-player';
export default {
setup() {
const embedVideo = ref(null);
const youtubeParams = {
playerVars: {
cc_load_policy: 1
}
};
const vimeoParams = {
responsive: true
};
onMounted(() => {
if (embedVideo.value) {
miraxEmbed(embedVideo.value, youtubeParams, vimeoParams);
}
});
return {
embedVideo
};
}
};
</script>
src/vue/TypeScriptPlayer.md
src/vue/TypeScriptEmbed.md
import { Component, ElementRef, OnInit, 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 OnInit, AfterViewInit {
@ViewChild('videoPlayer', { static: true }) videoPlayer!: ElementRef<HTMLVideoElement>;
ngOnInit(): void {
}
ngAfterViewInit(): void {
this.initializeMiraxplayer();
}
initializeMiraxplayer() {
if (this.videoPlayer.nativeElement) {
miraxplayer(this.videoPlayer.nativeElement);
}
}
}
example.component.html
<div>
<div class="mirax-player-class">
<video #videoPlayer
class="mirax-player"
data-mirax-player-width="800"
data-mirax-player-float=" "
data-mirax-player-theme=" "
data-mirax-player-bar=" "
src="assets/clip.mp4"></video>
</div>
</div>
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() {
if (this.videoPlayer.nativeElement) {
miraxplayer(this.videoPlayer.nativeElement);
}
}
}
example.component.html
<div class="mirax-embed-class">
<div #embedVideo
data-mirax-width="640"
data-mirax-height="360"
data-mirax-fullscreen="true"
data-mirax-controls="true"
data-mirax-embed="https://vimeo.com/217499569">
</div>
</div>
<script>
import { onMount } from 'svelte';
import { miraxplayer } from 'mirax-player';
let videoPlayer;
onMount(() => {
if (videoPlayer) {
miraxplayer(videoPlayer);
}
});
</script>
<div class="mirax-player-class">
<video bind:this={videoPlayer} class="mirax-player"
data-mirax-player-width="800"
data-mirax-player-float=" "
data-mirax-player-theme=" "
data-mirax-player-bar=" "
src="clip.mp4">
<track kind="captions" src="" label="English" default>
</video>
</div>
<script>
import { onMount } from 'svelte';
import { miraxEmbed } from 'mirax-player';
let embedVideo;
const youtubeParams = {
playerVars: {
cc_load_policy: 1
}
};
const vimeoParams = {
responsive: true
};
onMount(() => {
miraxEmbed(embedVideo, youtubeParams, vimeoParams);
});
</script>
<div class="mirax-embed-class">
<div bind:this={embedVideo}
data-mirax-width="640"
data-mirax-height="360"
data-mirax-fullscreen="true"
data-mirax-controls="true"
data-mirax-embed="https://vimeo.com/217499569"></div>
</div>
src/svelte/TypeScriptPlayer.md
src/svelte/TypeScriptEmbed.md
You can set-up attribute for position alignment of the video player.
data-mirax-player-float="left"
data-mirax-player-float=""
//or
data-mirax-player-float="center"
data-mirax-player-float="right"
data-mirax-player-theme="rgba(250, 149, 35, 0.9)"
data-mirax-player-bar="rgba(17, 117, 59, 0.9)"
data-mirax-player-theme="rgb(0,0,0)"
data-mirax-player-bar="rgb(255, 255, 255)"
data-mirax-player-theme="#000000"
data-mirax-player-bar="#00ff00"
data-mirax-player-theme="black"
data-mirax-player-bar="red"
data-mirax-player-theme = "rgba(0, 0, 0, 0)";
You have the freedom to freely set a theme color.
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 4 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.