# PlaybackFinished event failed to fire after finishing video with a pre-roll ads

**URL:** <https://community.bitmovin.com/t/playbackfinished-event-failed-to-fire-after-finishing-video-with-a-pre-roll-ads/3222>\
**Category:** Bugs\
**Tags:** bitmovin-player, bitmovin, web\
**Created:** [August 19, 2024, 7:35pm UTC](https://community.bitmovin.com/t/playbackfinished-event-failed-to-fire-after-finishing-video-with-a-pre-roll-ads/3222 "2024-08-19T19:35:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvist](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@alvist](https://community.bitmovin.com/u/alvist)\
**Post date:** [August 19, 2024, 7:35pm UTC](https://community.bitmovin.com/t/playbackfinished-event-failed-to-fire-after-finishing-video-with-a-pre-roll-ads/3222/1 "2024-08-19T19:35:48Z")

</div>

### Affected product

Player

### Affected platforms

web

### Description

PlaybackFinished event is not fired after video finished with a pre-roll ads and `chunked_cmaf_streaming` enabled in the config

### Expected behavior

PlaybackFinished event should fire successfully

### Reproduction steps

1. loaded the player with source with `chunked_cmaf_streaming` enabled in the config
2. register the playbackfinished event
3. after loading the player preload schedule the ads using `player.ads.schedule`
4. wait for video to end, PlaybackFinished event did not fire

### Additional details

 Bitmovin Player Demo 

```
    <!-- Bitmovin Player -->
    <script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8.174.0/bitmovinplayer.js"></script>

    <style>
        .player-wrapper {
            width: 90%;
            margin: 20px auto;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
        }
    </style>
</head>
<body>
    <div class="player-wrapper">
        <div id="player"></div>
    </div>

    <script type="text/javascript">
        var conf = {
            key: "203938a4-d824-48e6-945c-96ed8eb1c3d2",
            analytics: {
                key: "fdee6057-3ace-4436-975c-eabfd557534f",
                title: "Art of Motion",
                videoId: "wizard-Art_of_Motion-1724090759122"
            },
            tweaks: {
                chunked_cmaf_streaming: true
            },
            advertising: {}
        }

        var source = {
            title: "Art of Motion",
            dash: "https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd"
        }

        var player = new bitmovin.player.Player(document.getElementById("player"), conf)

        player.load(source).then(() => {
            player.ads.schedule({
                tag: {
                    type: "vast",
                    url: "https://7cead.v.fwmrm.net/ad/g/1?nw=511660&resp=vast4&prof=511660%3Agotham_lg_tv_vod_H&csid=gotham_lg_tv_vod&caid=CC3E7578-D36F-476E-92CA-4413AA8B24F5&asid=CC3E7578-D36F-476E-92CA-4413AA8B24F5&afid=CC3E7578-D36F-476E-92CA-4413AA8B24F5&metr=7&maxa=1&maxd=15&pvrn=1724092482384&vprn=1724092482384&vrdu=184.6166666;fwuid=DTC-ANNUAL;slid=722554575&tpcl=PREROLL&slau=PREROLL&ptgt=a&tpos=0"
                },
                id: "pre-roll-ads",
                position: "pre"
            })
        })

        player.on("playbackfinished", function () {
            console.log("Playback finished")
        })
    </script>
</body>

```
