OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Dash.js fetches .m4s files when setting video.currentTime and results in errors. Errors when setting video.currentTime in dash.js

  • Thread starter Thread starter YadneshD
  • Start date Start date
Y

YadneshD

Guest
Basically I need to start playing my .mpd file from a given duration using dash.js

I am able to play my .mpd file properly from start to end using dash.js in browser. But when I want to play it from a specific duration specified in secs, it requests for .m4s files and results in 404 error from server. Below is the JS code -

Code:
var video = document.getElementById('video-' + layerId);
var player = dashjs.MediaPlayer().create();
player.initialize(video, videoUrl, true);
player.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, function() {
    video.currentTime = 88; // 
});

Error in console -

XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash33.m4s 404 (NOT FOUND)

XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash34.m4s 404 (NOT FOUND) XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash35.m4s 404 (NOT FOUND)

If I comment my 2nd last line, // video.currentTime = 88; Then whole vide plays properly from start to end. But I need the video to start from a specific time say - 88 secs. How can I do it?

<p>Basically I need to start playing my .mpd file from a given duration using dash.js</p>
<p>I am able to play my .mpd file properly from start to end using dash.js in browser. But when I want to play it from a specific duration specified in secs, it requests for .m4s files and results in 404 error from server. Below is the JS code -</p>
<pre><code>
var video = document.getElementById('video-' + layerId);
var player = dashjs.MediaPlayer().create();
player.initialize(video, videoUrl, true);
player.on(dashjs.MediaPlayer.events.STREAM_INITIALIZED, function() {
video.currentTime = 88; //
});
</code></pre>
<p>Error in console -</p>
<p>XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash33.m4s 404 (NOT FOUND)</p>
<p>XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash34.m4s 404 (NOT FOUND)
XHRLoader.js:102 - GET http://localhost:5000/videos/m4d/video_dash35.m4s 404 (NOT FOUND)</p>
<p>If I comment my 2nd last line, <code>// video.currentTime = 88;</code> Then whole vide plays properly from start to end. But I need the video to start from a specific time say - 88 secs. How can I do it?</p>
 

Latest posts

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top