I am using this code in jw player to play audio.
<script type='text/javascript'>
jwplayer('player_1234').setup({
file: 'http://localhost/media.php?media_id=1822',
type: 'm4a',
width: '100%',
plugins: {},
aspectratio: '16:9',
fallback: 'false',
primary: jwplayer.utils.isChrome() ? "html5" : "html5"
});
</script>
Here, media.php file returns the the proper content-type audio header()
using readfile()
.
Media.php
works fine when i directly enter in browser.
But jw player gives this error message "Cannot read property 'sources' of undefined" when page is loaded. How can I fix this error?