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 an embed player for React, Vue, Angular, and Svelte that can embed videos from platforms like TikTok, YouTube/Shorts, and Vimeo
Mirax Player is an embed 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.
Frameworks / Library | Tested versions |
---|---|
18 & above | |
3 & above | |
16 & above | |
3 & above |
Version 6
Major changes:
Reminder:
Bugs Fixed:
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/ |
Props | Functionality | Type | Required |
---|---|---|---|
width | dynamic width | integer | yes !tiktok |
height | dynamic height | integer | yes !tiktok |
fullscreen | enable fullscreen | boolean | optional (true false) |
controls | enable controllers | boolean | optional (true false ) |
autoplay | enable autoplay | boolean | optional (true false) |
loop | enable loop | boolean | optional (true false) |
videoUrl | video address, url/links | any | yes |
src/react/TypeScriptEmbed.md
You can set many class names based on the total embed videos : ex.
.video-3
, .video-4
, .video-5
.
.video-1 {
display: inline-flex;
border: 2px solid red;
width: 100%;
max-width: 640px;
float: left;
}
.video-2 {
display: inline-flex;
border: 2px solid blue;
width: 100%;
max-width: 640px;
float: right;
}
.video-3 {
display: inline-flex;
border: 2px solid rgb(255, 0, 149);
width: 100%;
max-width: 640px;
margin: 0 auto;
height: 350px;
}
Note :
The width from the video data should also be equal to the max-width of .video-
in CSS.
You can embed one or more videos in any URL.
import React, { useRef, useEffect } from 'react';
import { embed } from 'mirax-player';
const ExampleComponent = () => {
const embedWrap = useRef(null);
useEffect(() => {
const videos = [
{
width: 640,
height: 310,
autoplay: false,
fullscreen: true,
controls: true,
videoUrl: 'https://vimeo.com/217499569',
},
{
width: 640,
height: 360,
autoplay: true,
fullscreen: true,
controls: false,
videoUrl: 'https://www.youtube.com/watch?v=vBGiFtb8Rpw',
},
{
videoUrl: 'https://www.tiktok.com/@scout2015/video/6718335390845095173',
},
];
embed(videos, embedWrap.current);
});
return <div ref={embedWrap}></div>;
};
export default ExampleComponent;
<template>
<div ref="embedWrap"></div>
</template>
<script>
import { onMounted, ref } from "vue";
import { embed } from 'mirax-player';
export default {
name: 'ExampleComponent',
setup() {
const embedWrap = ref(null);
onMounted(() => {
const videos = [
{
width: 640,
height: 310,
autoplay: false,
fullscreen: true,
controls: true,
videoUrl: 'https://vimeo.com/217499569',
},
{
width: 640,
height: 360,
autoplay: true,
fullscreen: true,
controls: false,
videoUrl: 'https://www.youtube.com/watch?v=vBGiFtb8Rpw',
},
{
videoUrl: 'https://www.tiktok.com/@scout2015/video/6718335390845095173',
},
];
embed(videos, embedWrap.value);
});
return {
embedWrap,
};
},
};
</script>
import { Component, ElementRef, AfterViewInit, ViewChild } from '@angular/core';
import { embed } from 'mirax-player';
@Component({
selector: 'app-example',
template: '<div #embedWrap></div>',
styleUrls: ['./example.component.css'],
})
export class ExampleComponent implements AfterViewInit {
@ViewChild('embedWrap') embedWrap!: ElementRef;
constructor() {}
ngAfterViewInit(): void {
const videos = [
{
width: 640,
height: 310,
autoplay: false,
fullscreen: true,
controls: true,
videoUrl: 'https://vimeo.com/217499569',
},
{
width: 340,
height: 410,
autoplay: true,
fullscreen: true,
controls: false,
videoUrl: 'https://www.youtube.com/watch?v=vBGiFtb8Rpw',
},
{
videoUrl: 'https://www.tiktok.com/@scout2015/video/6718335390845095173',
},
];
embed(videos, this.embedWrap.nativeElement);
}
}
<script>
import { onMount } from "svelte";
import { embed } from 'mirax-player';
const videos = [
{
width: 640,
height: 310,
autoplay: false,
fullscreen: true,
controls: true,
videoUrl: 'https://vimeo.com/217499569',
},
{
width: 640,
height: 360,
autoplay: true,
fullscreen: true,
controls: false,
videoUrl: 'https://www.youtube.com/watch?v=vBGiFtb8Rpw',
},
{
videoUrl: 'https://www.tiktok.com/@scout2015/video/6718335390845095173',
},
];
let embedWrap;
onMount(() => {
embed(videos, embedWrap);
});
</script>
<div bind:this={embedWrap}></div>
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.