OpenPlayerJS – HTML5 Video/Audio/YouTube Player – Integration

OpenPlayerJS – HTML5 Video/Audio/YouTube Player – Integration

GitHub :- https://github.com/openplayerjs/openplayerjs/

OpenPlayerJS :- https://www.openplayerjs.com/

Video

<hyperlink rel="stylesheet" href="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.css" />
<!-- Adding Css CDN -->


  <video class="op-player__media" id="participant" controls playsinline width="100%">
            <supply src="https://archive.org/obtain/sample-video_202306/PatternVideo.mp4" kind="video/mp4" />
  </video>

<hr>

<script src="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.js"></script>
<!-- Adding JavaScript CDN -->

<script>
// Check the `API and occasions` hyperlink beneath for extra choices
const participant = new OpenPlayerJS('participant');
participant.init();
</script>

Audio

<hyperlink rel="stylesheet" href="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.css" />
<!-- Adding Css CDN -->


<audio class="op-player__media" id="aud2" controls>
  <supply src="https://archive.org/obtain/sample-video_202306/PatternVideo.mp4" kind="audio/ogg">
</audio>

<hr>

<script src="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.js"></script>
<!-- Adding JavaScript CDN -->

<script>
// Check the `API and occasions` hyperlink beneath for extra choices
const player2 = new OpenPlayerJS('aud2');
player2.init();
</script>

YouTube Video

<hyperlink rel="stylesheet" href="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.css" />
<!-- Adding Css CDN -->


        <video class="op-player__media" id="player3" controls playsinline width="100%">
            <supply src="https://www.youtube.com/watch?v=xcJtL7QggTI" kind="video/x-youtube" />
        </video>

<hr>

<script src="https://cdn.jsdelivr.internet/npm/openplayerjs@newest/dist/openplayer.min.js"></script>
<script src="https://cdn.jsdelivr.internet/npm/[email protected]/dist/openplayerjs-youtube.min.js"></script>

<!-- Adding JavaScript CDNs (YouTube CDN Added) -->

<script>
// Check the `API and occasions` hyperlink beneath for extra choices
const player3 = new OpenPlayerJS('player3');
player3.init();
</script>

iframe

<iframe src="https://www.openplayerjs.com/embed.html?file=httpspercent3Apercent2Fpercent2Farchive.orgpercent2Fdownloadpercent2Fsample-video_202306percent2FSampleVideo.mp4&kind=video&autoplay=true" type="width:100%;peak:700px" frameborder="0" permit="fullscreen"></iframe>

Create Your iframe code Here :- https://www.openplayerjs.com/#strive

Checkout the Demo Below :-

OpenPlayerJS Examples

OpenPlayerJS Examples

Video

<br>
const participant = new OpenPlayerJS(&#39;participant&#39;);<br>
participant.init();<br>

Audio

<br>
const player2 = new OpenPlayerJS(&#39;aud2&#39;);<br>
player2.init();<br>

YouTube Video

<br>
const player3 = new OpenPlayerJS(&#39;player2&#39;);<br>
player3.init();<br>

iframe

HI-FI News

through DEV Community https://dev.to

January 31, 2024 at 08:40AM