This is a migrated thread and some comments may be shown as answers.

RadNotification doesn't work with RadMediaPlayer

1 Answer 41 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Venu Gadde
Top achievements
Rank 1
Venu Gadde asked on 03 Jun 2014, 07:49 PM
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.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Jun 2014, 07:11 AM
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.
Tags
Notification
Asked by
Venu Gadde
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or