shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
236 stars 63 forks source link

can shaka player play mpeg-ts file without any manifest #204

Open vandanachadha opened 3 years ago

vandanachadha commented 3 years ago

Have downloaded a sample ts file from https://filesamples.com/formats/ts and could not play it directly in the shaka player using video.src property.

Then created the manifest file as follows: master.m3u8

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=1123000,CODECS=ac-3
video.m3u8

video,m3u8

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:4.005333,
sample_960x540.ts
#EXT-X-ENDLIST

But this is also not working and get an error 1034 for this.

So questions:

  1. Can such standalone ts files and streams be played in shaka
  2. If yes, do I need to create a manifest file
  3. If yes, pls tell me whats wrong in the above manifest file. 4
TheModMaker commented 3 years ago

If you are trying to play a file that is locally on the device, we don't support local file playback (see #153). You need to pass a URL to play. Can you describe the error you are seeing? 1034 isn't a valid error code, so please check you typed the code correctly. Also you should look at the device logs for more info.

vandanachadha commented 3 years ago

This is the code where i am passing the url, this doesnt play:

<!DOCTYPE html>
<html>
  <head>
    <!-- Shaka Player compiled library: -->
    <script src="shaka-player/shaka-player.compiled.js"></script>
    <!-- Your application source: 
    <script src="myapp.js"></script> -->
  </head>
  <body>
    <video id="video"
           width="640"
           src="https://filesamples.com/samples/video/ts/sample_960x540.ts"
           controls autoplay></video>
  </body>
</html>

If i use the manifest file, then the error i get is 4022 (sorry, not 1032): myapp.js:44 Error code 4022 object B {severity: 2, category: 4, code: 4022, data: Array(0), handled: false}

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:5

#EXTINF:5,
http://localhost:3003/segments/segment_00000.ts
#EXTINF:3,
http://localhost:3003/segments/segment_00001.ts
#EXT-X-ENDLIST
TheModMaker commented 3 years ago

I'm confused by where you're using HTML. This is a native project that doesn't use HTML. The URL you pass to load should be the media file you want to play. You should check out our tutorial for more info.

Did you mean to post this on the JavaScript project for the browser?

The error 4022 is HLS_MASTER_PLAYLIST_NOT_PROVIDED. We don't support direct playback of media playlists, you need to provide a master playlist.