RadNotification doesn't work with RadMediaPlayer

2 posts, 0 answers
  1. Venu Gadde
    Venu Gadde avatar
    4 posts
    Member since:
    Dec 2009

    Posted 03 Jun 2014 Link to this post

    RadNotification doesn't load/show notification messages when there is a RadMediaPlayer on the form with a Playlist populated. Can somebody look into this?

    Thanks,

    Venu Gadde.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Jun 2014 in reply to Venu Gadde Link to this post

    Hi Venu Gadde,

    Please have a look into the sample code snippet which shows the RadNotification while playing the RadMediaPlayer.

    ASPX:
    <telerik:RadMediaPlayer ID="RadMediaPlayer2" runat="server" Width="700px" Height="500px"
        Source="../Images/RadControls.mp4" Poster="../Images/Poster1.jpg">
    </telerik:RadMediaPlayer>
    <telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval"  Width="300" Animation="Fade"  OnClientUpdated="OnClientUpdated" Title="Received messages" OffsetX="-20" OffsetY="-20"  UpdateInterval="3000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate">
        <ContentTemplate>
            <asp:Literal ID="lbl" runat="server"></asp:Literal>
        </ContentTemplate>
    </telerik:RadNotification>

    C#:
    protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e)
    {
        int newMsgs = DateTime.Now.Second % 10;
        if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0;
        lbl.Text = String.Concat(new object[] { "You have ", newMsgs, " new messages!" });
        RadNotification1.Value = newMsgs.ToString();
    }

    JavaScript:
    function OnClientUpdated(sender, args) {
        var message = "Update (check) was done!";
        var newMsgs = sender.get_value();
        if (newMsgs != 0) {
            sender.show();
            message += (newMsgs == 1) ? (" There is 1 new message!") : (" There are " + newMsgs + " new messages!");
        }
        else {
            message += " There are no new messages!";
        }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top