Change the playback speed from the player SDK

Our Player SDK has a new feature: you can set programatically the playback speed of your video!

<head>
    ...
    <script src="https://unpkg.com/@api.video/player-sdk" ></script>
</head>


<div id="target">
</div>

<script type="text/javascript">
    window.player = new PlayerSdk("#target", { 
        id: "vi3JYSbs2hkwgs1fd1uvCLfg", 
        autoplay:true,
		muted:true
    });
	
    player.addEventListener('play', function() { 
        console.log('play event received'); 
		player.setPlaybackRate(10);
    });
	 
</script>

In this example, the player will add the video with the specified videoId, set it to autoplay and muted (so it will play automatically).

Once the player sends the event “play”, the playback rate will be set to 10x.

This will be indicated in the lower right of the player:
image

In my experience - this works best on either:

really fast connections or
smaller views

The reason for this is that you have to download the video 10x faster than normal, so using a smaller size generally fares better for smooth playback

1 Like