Skip to content

MediaElement plugin to specify a segment of media to continuously loop

License

Notifications You must be signed in to change notification settings

alexgao1/mediaelement-ab-repeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mediaelement-ab-repeat

Based on the existing MediaElement Markers plugin.
Allows for looping a certain segment of media by setting two markers, A and B.

Right click on the time slider rail to set the markers, which represent the start and end points of the segment to be looped. If the current media time reaches marker B, it will return to marker A. If both markers are set, right click one more time to reset them.

Demo

Download and view demo.html within your browser.

Usage

Include either the minifed version or regular version of the plugin in a script tag.

<script src="src/ab-repeat/ab-repeat.min.js"></script>

Configuration options

{
    markerColors: ['#FF2D00', '#3235FF'],
    markerWidth: 1,
    features: [..., 'abrepeat'],
}

Event

When a marker is set, a custom event is dispatched from the slider element.
The element is named setmarker and its detail will contain two properties.

marker position
0 or 1 (representing either marker A or marker B) the time in seconds (the result of mejs.Utils.timeCodeToSeconds)

When the markers are cleared by right clicking when both markers are already set, an event resetmarkers is dispatched from the slider element.

About

MediaElement plugin to specify a segment of media to continuously loop

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published