Hi,
My requirement is to databind the media player playlist in code behind. However, when I try to populate the playlist from the code behind, I don't get anything in the playlist but only the first video plays. Can you please help?
What I currently do is:
In the aspx page:
<telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Height="554px" Width="692px">
<PlaylistSettings Mode="Buttons" ButtonsTrigger="Hover" />
</telerik:RadMediaPlayer>
And in the aspx.vb page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
RadMediaPlayer1.ToolBar.HDButton.Visible = False
RadMediaPlayer1.TitleBar.ShareButton.Visible = False
Dim table As DataTable = GetDataTable("SELECT * From Mytable", MyConnString)
For Each row As DataRow In table.Rows
Dim myfilename As String = row("myFilename") 'Mp4 file
Dim mytitle As String = row("mytitle")
Dim file As New MediaPlayerVideoFile() With {.Title = mytitle, .Poster = "poster.png"}
file.Sources.Add(New MediaPlayerSource() With {.Path = myfilename)})
RadMediaPlayer1.Playlist.Add(file)
Next
End Sub
Friend Shared Function GetDataTable(ByVal query As String, ByVal myConn As String) As DataTable
Dim connString As String = ConfigurationManager.ConnectionStrings(myConn).ConnectionString
Dim conn As SqlConnection = New SqlConnection(connString)
Dim myadapter As SqlDataAdapter = New SqlDataAdapter
myadapter.SelectCommand = New SqlCommand(query, conn)
Dim table As New DataTable
conn.Open()
Try
myadapter.Fill(table)
Catch ex As Exception
Finally
conn.Close()
End Try
Return table
End Function
My requirement is to databind the media player playlist in code behind. However, when I try to populate the playlist from the code behind, I don't get anything in the playlist but only the first video plays. Can you please help?
What I currently do is:
In the aspx page:
<telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Height="554px" Width="692px">
<PlaylistSettings Mode="Buttons" ButtonsTrigger="Hover" />
</telerik:RadMediaPlayer>
And in the aspx.vb page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
RadMediaPlayer1.ToolBar.HDButton.Visible = False
RadMediaPlayer1.TitleBar.ShareButton.Visible = False
Dim table As DataTable = GetDataTable("SELECT * From Mytable", MyConnString)
For Each row As DataRow In table.Rows
Dim myfilename As String = row("myFilename") 'Mp4 file
Dim mytitle As String = row("mytitle")
Dim file As New MediaPlayerVideoFile() With {.Title = mytitle, .Poster = "poster.png"}
file.Sources.Add(New MediaPlayerSource() With {.Path = myfilename)})
RadMediaPlayer1.Playlist.Add(file)
Next
End Sub
Friend Shared Function GetDataTable(ByVal query As String, ByVal myConn As String) As DataTable
Dim connString As String = ConfigurationManager.ConnectionStrings(myConn).ConnectionString
Dim conn As SqlConnection = New SqlConnection(connString)
Dim myadapter As SqlDataAdapter = New SqlDataAdapter
myadapter.SelectCommand = New SqlCommand(query, conn)
Dim table As New DataTable
conn.Open()
Try
myadapter.Fill(table)
Catch ex As Exception
Finally
conn.Close()
End Try
Return table
End Function
11 Answers, 1 is accepted
0
Hi Christos,
I've already replied in your ticket 794994. We will prepare the sample project as promised and send it to you when ready.
Regards,
Eyup
Telerik
I've already replied in your ticket 794994. We will prepare the sample project as promised and send it to you when ready.
Regards,
Eyup
Telerik
DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.
0
Christos
Top achievements
Rank 1
answered on 10 Mar 2014, 09:47 AM
Thanks Eyup,
I first posted here and then opened a ticket to speed it up. You can remove the post if you prefer.
I will be waiting for your sample project.
Many thanks,
Christos
I first posted here and then opened a ticket to speed it up. You can remove the post if you prefer.
I will be waiting for your sample project.
Many thanks,
Christos
0
Daniel Aquere
Top achievements
Rank 2
answered on 10 Apr 2014, 12:27 PM
Hi Eyup / Christos,
Please, could you share the sample?
I have the same problem.
Thanks.
Daniel
Please, could you share the sample?
I have the same problem.
Thanks.
Daniel
0
Hello Daniel,
I'm attaching the mentioned sample as requested. I hope it will prove helpful.
Regards,
Eyup
Telerik
I'm attaching the mentioned sample as requested. I hope it will prove helpful.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Markus
Top achievements
Rank 2
answered on 07 May 2014, 07:16 PM
Dear Eyup
I am evalutating RadMediaPlayer to pull videos (1-n) from Sitefinity Dynamic Modules and have some questions you might easily can answer.
I did have a look at your example and would like to know:
1) How do you add multiple videos to a playlist
1a) all having 3 formats
2) is it possible to auto loop videos.
2a) if only one play endless
2b) if multiple play 1 -> 2 -> 3 -> 1
3) Default seems to be that controls show and if not used fade out
3a) I could hide them with player.ToolBar.Visible = false; but is there a way to have it perform the other way around. Initially hidden and on mouse over shown
4) I would like the same with top bar. See screen shot. I would like to have that hidden and shown on mouse over with the playlist closed.
5) Can it be that I am missing the API Reference for the RadMediaPlayer here: http://www.telerik.com/help/aspnet-ajax/n_telerik_web_ui_menu.html
Thanks for your help in advance.
Markus
I am evalutating RadMediaPlayer to pull videos (1-n) from Sitefinity Dynamic Modules and have some questions you might easily can answer.
I did have a look at your example and would like to know:
1) How do you add multiple videos to a playlist
1a) all having 3 formats
2) is it possible to auto loop videos.
2a) if only one play endless
2b) if multiple play 1 -> 2 -> 3 -> 1
3) Default seems to be that controls show and if not used fade out
3a) I could hide them with player.ToolBar.Visible = false; but is there a way to have it perform the other way around. Initially hidden and on mouse over shown
4) I would like the same with top bar. See screen shot. I would like to have that hidden and shown on mouse over with the playlist closed.
5) Can it be that I am missing the API Reference for the RadMediaPlayer here: http://www.telerik.com/help/aspnet-ajax/n_telerik_web_ui_menu.html
Thanks for your help in advance.
Markus
0
Markus
Top achievements
Rank 2
answered on 08 May 2014, 06:10 PM
Dear Eyup
Here is what I got so far:
http://staging.bskd.ch.mserver5.arvixevps.com/test
What I now need:
1) Hide the playlist initially
2) Have the videos play one after the other
Problem/Bug:
1) When you hide the toolbar the playlist and titlebar (hide/show playlist) do not work.
Markus
Here is what I got so far:
http://staging.bskd.ch.mserver5.arvixevps.com/test
What I now need:
1) Hide the playlist initially
2) Have the videos play one after the other
Problem/Bug:
1) When you hide the toolbar the playlist and titlebar (hide/show playlist) do not work.
Markus
0
Markus
Top achievements
Rank 2
answered on 09 May 2014, 07:45 AM
Well I found out that I can use CSS to do a lot of thing.
What I have not solved yet is:
2) is it possible to auto loop videos.
2a) if only one play endless
2b) if multiple play 1 -> 2 -> 3 -> 1
Markus
What I have not solved yet is:
2) is it possible to auto loop videos.
2a) if only one play endless
2b) if multiple play 1 -> 2 -> 3 -> 1
Markus
0
Hi Markus,
I've modified the sample to demonstrate how you can achieve requirements 1,2,3 and 4 although I couldn't find any attached images. As for point 5, you can find the main classes for every control in the Telerik.Web.UI Namespace:
http://www.telerik.com/help/aspnet-ajax/t_telerik_web_ui_mediaplayervideofile.html
Hope this helps.
Regards,
Eyup
Telerik
I've modified the sample to demonstrate how you can achieve requirements 1,2,3 and 4 although I couldn't find any attached images. As for point 5, you can find the main classes for every control in the Telerik.Web.UI Namespace:
http://www.telerik.com/help/aspnet-ajax/t_telerik_web_ui_mediaplayervideofile.html
Hope this helps.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Markus
Top achievements
Rank 2
answered on 13 May 2014, 06:43 AM
Dear Eyup
Once again outstanding. Exactely what I needed. You would get 105 points out of 100 possible.
People like you make Telerik so special.
Once again thanks a whole heap.
Markus
Once again outstanding. Exactely what I needed. You would get 105 points out of 100 possible.
People like you make Telerik so special.
Once again thanks a whole heap.
Markus
0
Arnaud
Top achievements
Rank 1
answered on 09 Mar 2015, 04:21 PM
We could say it's outstanding if it was in documentation (its real place) and not in a file in one thread of the forum...
As it is a server control, populating it server side should be in documentation...
As it is a server control, populating it server side should be in documentation...
0
Hello Arnaud,
I agree with you that Programmatic Creation article should be added in the documentation. I have already contacted the team responsible for RadMediaPlayer control and they confirmed that such an article will be created as soon as possible. Please excuse us for the inconvenience caused.
Regards,
Pavlina
Telerik
I agree with you that Programmatic Creation article should be added in the documentation. I have already contacted the team responsible for RadMediaPlayer control and they confirmed that such an article will be created as soon as possible. Please excuse us for the inconvenience caused.
Regards,
Pavlina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.