npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.adrenak.mediaplayer

v2.2.0

Published

A Media Player abstraction that standardises video players. Includes UnityMediaPlayer based on Unity's VideoPlayer.

Downloads

11

Readme

MediaPlayer

A standardised media player interface for Unity. Aimed largely towards being able to make video player UI without worrying about the underlying video player.

Media Playback

The IVideoPlayer interface

Properties

  • Texture The Texture object that represents the texture on which the video plays
  • IsReady If the video player has loaded the video and the video can be played or not
  • IsPlaying If the video is presently playing. False when the video is not loaded or paused.
  • Duration The duration of the video in a TimeSpan object
  • TotalFrames Total number of frames in the video that has been loaded
  • FrameRate Rate of frame playback in frames per second of the loaded video
  • CurrentFrame The currently showing frame in the video player
  • CurrentPosition The normalized position of the current frame in the [0,1] rannge
  • CurrentTimeSpan The time gap between the video start and the current frame showing

Methods

  • Open(string path, bool autoPlay) Opens a video for loading via the path. autoPlay flag decides if the video playback should start immediately after successful loading.

  • Play Starts playing/resumes the video

  • Pause Pauses the video playback

  • Stop Stop the video playback

  • SeekFrame(long frame) Seeks the playback to the given frame from the start of the video

  • SeekTimeSpan(TimeSpan timeSpan) Seeks the playback to a frame timeSpan duration from the start of the video

  • SeekPosition(float position) Seeks the playabck to a frame position percentage from the start of the video. Eg. .5f seeks it to the middle of the video

  • JumpFrames(long frameDelta) Seeks to a frame frameDelta frames away from the current frame

  • JumpTimeSpan(TimeSpan timeSpanDelta) Seeks to a frame timeSpanDelta duration away from the current frame

  • JumpPosition(float positionDelta) Seeks to a frame positionDelta percentage from the current frame. Eg. -25f when CurrentPosition is .75f will take it to the middle of the video

Events

  • OnReady Fired when a video is loaded and it capable of being player
  • OnError Fired when there is an error in loading the video
  • OnPlay Fired when the video starts playing for the first time or is resumed in the middle of the playback
  • OnPause Fired when the video is paused
  • OnStop Fired when the playback is stopped
  • OnSeek Fired when the media player seeks to another frame
  • OnJump Fired when the media played jumps forward or backward by any number of frames

Subtitles

Subtitle related code is a modified version of @roguecode's Unity-Simple-SRT on GitHub.

The SubtitleBlock class

Properties

  • Index The Index of the block in the subtitle file.
  • Length The duration of the subtitle block in seconds
  • From The moment the subtitles should start displaying
  • To The moment the subtitles should stop displaying
  • Text The text to be displayed

The ISubtitlesParser interface

Methods

  • GetByTime(double time) Returns the subtitle block from the subtitle file at the specified time

Notes

The project contains the following:

  • IVideoPlayer: An implementation for Unity's VideoPlayer component. Please see SampleMediaPlayer under Samples/
  • SRTParser: An implementation of ISubtitlesParser for working with SRT subtitle format.
  • SubtitleDisplayer: A simple UI for showing the subtitles that requires an instance of ISubstitlesParser

Contact

Vatsal "adrenak" Ambastha
@www
@github
@npm