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 inline events for static content are removed after triggering preventing trickplay within the content from triggering them again #4416

Open
4 tasks done
Cheleri opened this issue Mar 12, 2024 · 0 comments
Milestone

Comments

@Cheleri
Copy link

Cheleri commented Mar 12, 2024

Environment
  • Link to playable MPD file: Instructions to create one are below.
  • Dash.js version: 4.7.4
  • Browser name/version: Chrome/122.0.6261.112
  • OS name/version: Sonoma 14.2.1
Steps to reproduce

I used ffmpeg 6.1 with the command line "ffmpeg -i bbb.mp4 -c:v copy -an -use_timeline 1 -use_template 1 -f dash demo.mpd" where bbb.mp4 is a version of Blenders Big Buck Bunny to create an MPEG Dash version of it.

Then I modified the resulting MPD and added:

<EventStream schemeIdUri="urn:my:custom" value="1" timescale="1000">
	<Event presentationTime="5000" duration="5000" id="1">Custom event 1</Event>
	<Event presentationTime="10000" duration="1000" id="2">Custom event 2</Event>
	<Event presentationTime="45000" duration="5000" id="3">Custom event 3</Event>
</EventStream>

Below the first <Period id="0".... > line and above the <AdaptationSet id="0"....> line.

Then you can use a pretty stock html page similar to:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">

        <script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>

        <style>
            video {
                width: 480px;
                height: 360px;
            }
        </style>
	</head>

    <body>
        <video controls="true"></video>

        <script class="code">
            function init() {
                var video,
                    player,
                    url = "./demo.mpd";
                    
                video = document.querySelector('video');
                player = dashjs.MediaPlayer().create();
                player.on("urn:my:custom", handleCustomEvent);
                player.initialize(video, url, false);
            }

            function handleCustomEvent(e) {
                console.log(e.event.messageData)
            }
            
            document.addEventListener('DOMContentLoaded', function () {
                init();
            });
        </script>
	</body>
</html>

to play the resulting content. The video plays fine, the events on the other hand are only delivered to the listener once.

Reproducible 100% of the time.

Observed behavior

The events added to the MPD are received once and only once by the registered listeners. Load the html page, start playback and you can see in the console:

Custom event 1 index.html:32
Custom event 2 index.html:32
Custom event 3 index.thml:32

The first time the playback passes the specified presentation times. Use the scrubber bar to go back before the events again and the events are never delivered again.

Console output

See above.

Expected behavior

Every time the presentation time for an MPD defined event is at the playpoint, the event should be passed to the registered listeners.

@Cheleri Cheleri added the Bug label Mar 12, 2024
@dsilhavy dsilhavy added this to the 5.0.0 milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants