Unplanned
Last Updated: 07 Feb 2023 09:39 by ADMIN
David
Created on: 26 Mar 2014 18:48
Category: MediaPlayer
Type: Feature Request
4
Add option to auto play all videos in playlist for RadMediaPlayer
Add option to auto play all videos in playlist.  After it finishes first video, the next video in playlist should get highlighted in PlayList and video should start playing.  Continue until the end of the playlist.
2 comments
ADMIN
Rumen
Posted on: 07 Feb 2023 09:39

Hi folks,

You can take advantage of the solution provided in the following knowledge base article: Automatically play next video and have a PlayNext button, e.g.

 

        <telerik:RadScriptBlock runat="server">
            <script>
                function playNextVideo(mediaPlayer) {
                    var ACTIVE = "rmpActive";
                    var nextIndex = mediaPlayer.mediaFiles.indexOf(mediaPlayer.currentFile) + 1
                    if (nextIndex < mediaPlayer.mediaFiles.length) {
                        var nextVideo = mediaPlayer.mediaFiles[nextIndex];
                        mediaPlayer.currentPlayer.loadFile(nextVideo);
                        mediaPlayer.currentFile = nextVideo;
                        // update the highlighted item in the playlist
                        mediaPlayer.playlist._$list
                            .children()
                            .removeClass(ACTIVE)
                            .eq(nextIndex)
                            .addClass(ACTIVE);
                    }
                }

                function OnClientEnded(sender, args) {
                    playNextVideo(sender);
                }

            </script>
        </telerik:RadScriptBlock>
        <telerik:RadMediaPlayer OnClientEnded="OnClientEnded" RenderMode="Lightweight" ID="RadMediaPlayer1" runat="server"
            Height="360px" EnableViewState="false" Width="640px" AutoPlay="true">
            <Playlist>
                <telerik:MediaPlayerVideoFile Title="Icenium" Poster="icenium.png">
                    <Sources>
                        <telerik:MediaPlayerSource Path="../MediaTypes/Video/Progress_Telerik_Booth.mp4" />
                    </Sources>
                </telerik:MediaPlayerVideoFile>
                <telerik:MediaPlayerVideoFile Title="JustCode" Poster="justCode.png">
                    <Sources>
                        <telerik:MediaPlayerSource Path="../MediaTypes/Video/justCode.mp4" />
                    </Sources>
                </telerik:MediaPlayerVideoFile>
            </Playlist>
        </telerik:RadMediaPlayer>

 

Regards,
Rumen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

dadal
Posted on: 06 Oct 2014 10:32
Yes, it would be great.