# Plugins

### Media Player

Inside the media cards, for both the audio and video players we have used the Plyr Library. In order to see the full documentation, you can go [here](https://github.com/sampotts/plyr).

In order to use it, you will need to import its custom CSS and JS. We have used their CDN, but you can also download the files from Github and import them in your project.

Needed files:

```markup
<link rel="stylesheet" href="https://cdn.plyr.io/3.3.21/plyr.css">
<script src="https://cdn.plyr.io/3.3.21/plyr.polyfilled.js"></script>
```

### Example

Here is an example for a audio player inside a card:

![](/files/-LG6BXoPK1AkfchSBLON)

```markup
<!-- html -->
<div class="card card-full-image card-audio-4" style="background-image: url('assets/media/img/video/audio_4.jpg')">
	<div class="card-header d-flex justify-content-between">
		<div class="p-2">
			<a href="#" class="btn btn-xs btn-link">Popular</a>
		</div>
		<div class="p-2">
			<a href="#" class="btn btn-xs btn-link btn-white"><i class="fas fa-ellipsis-h"></i></a>
		</div>
	</div>
	<div class="card-body">	
		<div class="row">
			<div class="col-md-4 offset-md-6">
				<div class="info">
					<h3 class="track">London</h3>
					<h6 class="artist">Benjamin Clementine</h6>
				</div>
				<div class="player">
					<audio id="player4" controls>
					  <source src="assets/media/audio/kendrick.mp3" type="audio/mp3">
					  Your browser does not support the audio element.
					</audio>
				</div>
			</div>
		</div>
	</div>
</div>
```

```javascript
//javascript
const player4 = new Plyr('#player4',{
	controls: ['play', 'progress', 'current-time', 'duration', 'fullscreen']
});	
```

### Sliders

In order to add sliders to the page, we have used the noUISliders and have added a layer of design. To see the full functionality of the library, you can check they [GitHub Documentation](https://refreshless.com/nouislider/).

And here is an example of how to use it:

![](/files/-LG66SVJ1hGsUGm9XsX8)

```markup
<!-- html -->
<div class="d-flex justify-content-between">
	<div class="left">
		<span id="price-left" class="price-left pull-left" data-currency="$">100</span>
	</div>
	<div class="dash">-</div>
	<div class="right">
		<span id="price-right" class="price-right pull-right" data-currency="$">850</span>
	</div>
</div>
<div id="sliderRefine" class="slider slider-refine"></div>
```

```javascript
//javascript
var slider = document.getElementById('sliderRefine');

noUiSlider.create(slider, {
    start: [150, 1600],
    connect: true,
    range: {
        'min': [0],
        'max': [2000]
    }
});

var limitFieldMin = document.getElementById('price-left');
var limitFieldMax = document.getElementById('price-right');

slider.noUiSlider.on('update', function(values, handle) {
    if (handle) {
        limitFieldMax.innerHTML = $('#price-right').data('currency') + Math.round(values[handle]);
    } else {
        limitFieldMin.innerHTML = $('#price-left').data('currency') + Math.round(values[handle]);
    }
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bootstrapbay.gitbook.io/grace-ui-kit/plugins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
