IMediaStreamFileMapper -> streamToFileForRead called multiple times per video
I'm totally new to the wowza community, I've developed a small plugin module to find the videos location in a DB when requested by ID creating a class that extends the IMediaStreamFileMapper and registering the mapper onAppStart with appInstance.setStreamFileMapper(mapperInstance)
What I quickly noticed is that the streamToFileForRead method of the mapper is called multiple (5-6) times per video despite it returns always the same output which causes multiple database requests as you can imagine ... an unwanted behaviour. So as I was not able to find documentation on the subject - is this behaviour by design? Is this thing somehow a subject of configuration? Or is it a problem with the way I register the mapper? What can I do to prevent it except of caching data retrieved once from the database?
Ya that event handler will be invoked several times per read etc. Another approach may be to take a look at the following
module from our collection. The RandomAccessReaderSourceSelector class gives an implementation where you could leverage the IRandomAccessReader interface and access your asset initially via the init() event.