Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
mirax-player
Advanced tools
Mirax Player is a javascript video player for react and vue.
https://www.npmjs.com/package/mirax-player
To install the Mirax Player, you can use the following npm command:
npm install mirax-player
In your component
Then use it from Mirax Player:
//both react and vue importing syntax
import { mirax } from 'mirax-player';
// for react
const [isPlaying, setIsPlaying] = useState(false);
const videoRef = useRef(null);
//
// for vue
const isPlaying = ref(false);
const videoRef = ref(null);
//
///
In your React component
import React, { useEffect, useState, useRef } from 'react';
import { mirax } from 'mirax-player';
const ExampleComponent = () => {
const [isPlaying, setIsPlaying] = useState(false);
const videoRef = useRef(null);
useEffect(() => {
if (videoRef.current) {
mirax(videoRef.current, isPlaying, setIsPlaying);
}
}, [isPlaying]);
return (
<div>
<div className='whatever'>
<video ref={videoRef} className="mirax" src="clip.mp4"></video>
</div>
</div>
);
};
export default ExampleComponent;
In your Vue component
<template>
<div>
<div class="whatever">
<video ref="videoRef" class="mirax" src="clip.mp4"></video>
</div>
</div>
</template>
<script>
import { ref, onMounted, watch } from 'vue';
import { mirax } from 'mirax-player';
export default {
name: 'ExampleComponent',
setup() {
const isPlaying = ref(false);
const videoRef = ref(null);
onMounted(() => {
if (videoRef.value) {
mirax(videoRef.value, isPlaying.value, setIsPlaying);
}
});
watch(isPlaying, () => {
if (videoRef.value) {
mirax(videoRef.value, isPlaying.value, setIsPlaying);
}
});
function setIsPlaying(value) {
isPlaying.value = value;
}
return {
videoRef
};
}
};
</script>
<style scoped>
/* Add your styles here */
</style>
add in your css file .mirax-inject
note: .whatever, you can rename it, just make sure the classname in your component also replace it.
// in React
<div className='whatever'>
<video ref={videoRef} className="mirax" src="clip.mp4"></video>
</div>
// in vue
<div class="whatever">
<video ref="videoRef" class="mirax" src="clip.mp4"></video>
</div>
.whatever {
margin: 0 auto;
text-align: center;
}
.mirax-inject {
margin: 0 auto;
text-align: center;
}
MIT
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.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.