Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

media-tracks

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

media-tracks - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

68

dist/media-shim.js

@@ -19,30 +19,38 @@ import { VideoTrack } from "./video-track.js";

)?.get;
Object.defineProperty(HTMLMediaElement.prototype, "videoTracks", {
get() {
return initVideoTrackList(this);
}
});
Object.defineProperty(HTMLMediaElement.prototype, "audioTracks", {
get() {
return initAudioTrackList(this);
}
});
HTMLMediaElement.prototype.addVideoTrack = function(kind, label = "", language = "") {
const videoTrackList = initVideoTrackList(this);
const track = new VideoTrack();
track.kind = kind;
track.label = label;
track.language = language;
videoTrackList.add(track);
return track;
};
HTMLMediaElement.prototype.addAudioTrack = function(kind, label = "", language = "") {
const audioTrackList = initAudioTrackList(this);
const track = new AudioTrack();
track.kind = kind;
track.label = label;
track.language = language;
audioTrackList.add(track);
return track;
};
if (!HTMLMediaElement.prototype.videoTracks) {
Object.defineProperty(HTMLMediaElement.prototype, "videoTracks", {
get() {
return initVideoTrackList(this);
}
});
}
if (!HTMLMediaElement.prototype.audioTracks) {
Object.defineProperty(HTMLMediaElement.prototype, "audioTracks", {
get() {
return initAudioTrackList(this);
}
});
}
if (!HTMLMediaElement.prototype.addVideoTrack) {
HTMLMediaElement.prototype.addVideoTrack = function(kind, label = "", language = "") {
const videoTrackList = initVideoTrackList(this);
const track = new VideoTrack();
track.kind = kind;
track.label = label;
track.language = language;
videoTrackList.add(track);
return track;
};
}
if (!HTMLMediaElement.prototype.addAudioTrack) {
HTMLMediaElement.prototype.addAudioTrack = function(kind, label = "", language = "") {
const audioTrackList = initAudioTrackList(this);
const track = new AudioTrack();
track.kind = kind;
track.label = label;
track.language = language;
audioTrackList.add(track);
return track;
};
}
function initVideoTrackList(media) {

@@ -98,3 +106,3 @@ let tracks = videoTrackLists.get(media);

}
if (globalThis.VideoTrack) {
if (globalThis.VideoTrack && !globalThis.VideoTrack.prototype.renditions) {
Object.defineProperty(globalThis.VideoTrack.prototype, "renditions", {

@@ -106,3 +114,3 @@ get() {

}
if (globalThis.AudioTrack) {
if (globalThis.AudioTrack && !globalThis.AudioTrack.prototype.renditions) {
Object.defineProperty(globalThis.AudioTrack.prototype, "renditions", {

@@ -109,0 +117,0 @@ get() {

{
"name": "media-tracks",
"version": "0.0.2",
"version": "0.0.3",
"description": "Polyfill audio and video tracks with renditions.",

@@ -5,0 +5,0 @@ "type": "module",

# Media Tracks
[![Version](https://img.shields.io/npm/v/media-tracks?style=flat-square)](https://www.npmjs.com/package/media-tracks)
[![Badge size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/media-tracks/+esm?compression=gzip&label=gzip&style=flat-square)](https://cdn.jsdelivr.net/npm/media-tracks/+esm)
Polyfills the media elements (`<audio>` or `<video>`) adding audio and video tracks (as [specced](https://html.spec.whatwg.org/multipage/media.html#media-resources-with-multiple-media-tracks)) and with renditions as proposed in [media-ui-extensions](https://github.com/video-dev/media-ui-extensions).

@@ -4,0 +8,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc