Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPD Support #133

Open
ale1967 opened this issue Mar 20, 2021 · 7 comments
Open

MPD Support #133

ale1967 opened this issue Mar 20, 2021 · 7 comments

Comments

@ale1967
Copy link

ale1967 commented Mar 20, 2021

Sorry to bother with an open issue, but I haven't found any information and don't know how to ask.

Is mld supported, every time I try to open an mpd file I have an error on wavesufer.js exactly here

function fetchFile(options) {
  if (!options) {
    throw new Error('fetch options missing');
  } else if (!options.url) {
    throw new Error('fetch url missing');

because the url is empty, while with an mp4 is correct and works smoothly.

Thanks

I'm using

video.js version 7.7.5
dash.all.min.js version 3.2.1
videojs-dash.min.js version 4.1.0
wavesurfer.js version 4.6.0
videojs.wavesurfer.js version 3.6.0
the exact error is

at Object.fetchFile (wavesurfer.js:2656)
at WaveSurfer.getArrayBuffer (wavesurfer.js:5035)
at WaveSurfer.loadMediaElement (wavesurfer.js:4979)
at WaveSurfer.load (wavesurfer.js:4887)
at Wavesurfer.load (videojs.wavesurfer.js:641)
at Object.setSource (videojs.wavesurfer.js:158)
at setSourceHelper (video.js:12112)
at video.js:12123
at Object.setSource (video.js:54792)
at setSourceHelper (video.js:12112)

the video.js tag in the html is

video crossOrigin="anonymous"
id="videoPlayer"
ng-if="AssetDetailMessage.length > 0"
class="video-js vjs-default-skin vjs-16-9 vjs-fill vjs-big-play-centered"
controls preload="metadata"
width="1000"
height="562"
vjs-setup="{
fluid: true,
responsive: true,
autoplay: false,
playbackRates: [1, 2, 4, 8],
plugins: {
wavesurfer: {
backend: 'MediaElement',
displayMilliseconds: false,
debug: true,
waveColor: 'rgba(255, 255, 255, .3)',
progressColor: '#065fd4',
cursorColor: '#065fd4',
hideScrollbar: true,
container: '#waveform',
normalize: true
}
}
}"
vjs-media="mediaToggle"
vjs-video
tabindex="-1">
</video

so this is the config of wavesurfer, correct ?

wavesurfer: {
backend: 'MediaElement',
displayMilliseconds: false,
debug: true,
waveColor: 'rgba(255, 255, 255, .3)',
progressColor: '#065fd4',
cursorColor: '#065fd4',
hideScrollbar: true,
container: '#waveform',
normalize: true
}

@thijstriemstra
Copy link
Member

@ale1967 what does your videojs-wavesurfer config look like? what version of videojs-wavesurfer and wavesurfer.js? and what is the exact error?

@ale1967 ale1967 closed this as completed Mar 20, 2021
@ale1967 ale1967 reopened this Mar 20, 2021
@ale1967
Copy link
Author

ale1967 commented Mar 20, 2021

Sorry, I'm not very familiar with GitHub. Added info on first comment

@thijstriemstra
Copy link
Member

where do you load the file? i dont see any player.src() call?

@ale1967
Copy link
Author

ale1967 commented Mar 20, 2021

i have angularjs and in the controller I have a function that set the src, an extract

if ($scope.selectProxy.endsWith("mp4")) {
    playerIstance.src([
        {
            type: "video/mp4",
            src: $scope.selectProxy
        }
    ]);
} else if ($scope.selectProxy.endsWith("m3u8")) {
    playerIstance.src([
        {
            type: "application/x-mpegURL",
            src: $scope.selectProxy
        }
    ]);
} else if ($scope.selectProxy.endsWith('mpd')) {
    playerIstance.src([
        {
            type: "application/dash+xml",
            src: $scope.selectProxy
        }
    ]);
}

if the source is an .mp4 the player loads correctly and also the waveform is shown without problem.
If it's a .mpd file, the player loads without problems, it is possible to switch between audio track (I have an mpd with two audio tracks) and I can listen the audio that change.
But I see the error in the chrome console (reported previously) and I don't see the waveform.

If I put a breakpoint to the function of waveform.js

function fetchFile(options) {
  if (!options) {
    throw new Error('fetch options missing');
  } else if (!options.url) {
    throw new Error('fetch url missing');

I can see that options.url contains the url of the mp4, while with the mpd the url is ""

@ale1967
Copy link
Author

ale1967 commented Mar 21, 2021

Doing some tests (hope this can help) I have seen this:

  • First execution with mp4 file using http url

I can see the url (line 151 videos.wavesurfer.js)

Schermata 2021-03-21 alle 13 16 45

this is the console.log of element field, it contains the url

Schermata 2021-03-21 alle 13 17 21

  • Second execution with mpd file always with http url

Same as previous I can see the url (line 151 videos.wavesurfer.js)

Schermata 2021-03-21 alle 13 17 49

this is the console.log of element field, it NOT contains the url

Schermata 2021-03-21 alle 13 18 03

@thijstriemstra
Copy link
Member

thijstriemstra commented Mar 22, 2021

@thijstriemstra
Copy link
Member

@ale1967 see #17 (comment) for some more investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants