
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
castable-video
Advanced tools
is="castable-video"
Cast your video element to the big screen with ease!
The lightweight CastableVideo
class extends the native HTMLVideoElement
API and adds casting functionality to any video element. The API was designed to have the feel of a native browser API similar to the other screen presentation API's.
It was primarily built for use in Media Chrome but it works great with any custom video controls as you can see in the example.
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
<script type="module" src="./castable-video.js"></script>
<video
id="castable"
is="castable-video"
src="https://stream.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/high.mp4"
></video>
<button onclick="window.castable.play()">Play</button>
<button onclick="window.castable.pause()">Pause</button>
<button onclick="window.castable.requestCast()">Request Cast</button>
<button onclick="window.CastableVideo.exitCast()">Exit Cast</button>
<script>
window.castable.addEventListener('castchange', function (event) {
console.log(event.type, event.detail);
});
</script>
video.requestCast(options)
CastableVideo.exitCast()
CastableVideo.castElement
CastableVideo.castAvailable
entercast
leavecast
castchange
e.g. video.addEventListener('entercast', () => {})
stream-type
: add <video "stream-type="live">
for live streams.cast-src
: if Chromecast requires a different source than the one loaded.FAQs
Cast your video element to the big screen with ease!
The npm package castable-video receives a total of 97,830 weekly downloads. As such, castable-video popularity was classified as popular.
We found that castable-video demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.