RadMediaPlayer using MediaPlayerAudioFile and MediaPlayerVideoFile concurrent

3 posts, 0 answers
  1. Hasan
    Hasan avatar
    11 posts
    Member since:
    Dec 2013

    Posted 28 May 2014 Link to this post

    i use RadMediaPlayer in my project and i want in playlist add both audio and video. my code is: SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["conection"].ConnectionString);
    SqlCommand cmd = new SqlCommand("SELECT Extension,Detail,Link,Title,Folder,Pic FROM [TblQuality] WHERE mId=@mId", con);
    cmd.Parameters.AddWithValue("@mId", QSi);
    SqlDataReader dr;
    MediaPlayerFile file;
    using (con)
    {
    con.Open();
    dr = cmd.ExecuteReader();
    while (dr.Read())
    {
    if (!dr.GetString(2).ToLower().EndsWith(".rar") || !dr.GetString(2).ToLower().EndsWith(".zip"))
    {
    //new media
    if (dr.GetString(2).ToLower().EndsWith(".mp3"))
    {
    file = new MediaPlayerAudioFile()
    {
    Poster = string.Format("~/Management/images/Music_img/{0}/{1}", dr.GetString(4), dr.GetString(5)),
    Path = string.Format("~/Cnt/Music/{0}/{1}", dr.GetString(4), dr.GetString(2)),
    Title = string.Format("{0}.{1} - {2}", dr.GetString(3), dr.GetString(0), dr.GetString(1))
    };
    RadMP1MusicDown.Playlist.Add(file);
    }
    else
    {
    file = new MediaPlayerVideoFile()
    {
    Poster = string.Format("~/Management/images/Music_img/{0}/{1}", dr.GetString(4), dr.GetString(5)),
    Path = string.Format("~/Cnt/Music/{0}/{1}", dr.GetString(4), dr.GetString(2)),
    Title = string.Format("{0}.{1} - {2}", dr.GetString(3), dr.GetString(0), dr.GetString(1))
    };
    RadMP1MusicDown.Playlist.Add(file);
    }
    }
    }
    dr.Close();
    cmd.Cancel();
    }but when load page, media play are only in audio mode or video mode.if first item is mp3 and second is mp4 when video play mediaplayer don't show video only play sound.can help me fix this?
    -------------------------------------
    hgh system MediaSpace
  2. Hasan
    Hasan avatar
    11 posts
    Member since:
    Dec 2013

    Posted 31 May 2014 Link to this post

    hi every one.no body can't help me.this is easy, think i have a programmatic media player that in playlist has both audio and video.i want when mediaplayer play audio being in audio mode and when pla video be in video mode.
    my code like this:
                SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["HGHDB"].ConnectionString);
                SqlCommand cmd = new SqlCommand("SELECT Extension,Detail,Link,Title,Folder,Pic FROM [TblQuality] WHERE mId=@mId", con);
                cmd.Parameters.AddWithValue("@mId", QSi);
                SqlDataReader dr;
                MediaPlayerFile file;
                using (con)
                {
                    con.Open();
                    dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        if (!dr.GetString(2).ToLower().EndsWith(".rar") || !dr.GetString(2).ToLower().EndsWith(".zip"))
                        {
                            //new media
                            if (dr.GetString(2).ToLower().EndsWith(".mp3"))
                            {
                                file = new MediaPlayerVideoFile()
                                {
                                    Poster = string.Format("~/Management/images/Music_img/{0}/{1}", dr.GetString(4), dr.GetString(5)),
                                    Path = string.Format("~/Cnt/Music/{0}/{1}", dr.GetString(4), dr.GetString(2)),
                                    Title = string.Format("{0}.{1} - {2}", dr.GetString(3), dr.GetString(0), dr.GetString(1))
                                };
                                RadMP1MusicDown.Playlist.Add(file);
                                MusicName = dr.GetString(3);
                            }
                        }
                    }
                }
    -------------------------------------
    hgh system MediaSpace






  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 02 Jun 2014 Link to this post

    Hello Hasan,

    When a combination of Video and Audio files is used within one Playlist, only the first type will be taken into account, which will lead to the behavior that you are describing. 

    With the current implementation of the control it is not possible to have a mixed playlist (containing video and audio files) and you must have a separate playlists for each type (as demonstrated in our online demo MediaPlayer - Media Types).

    Nevertheless, if you think that such functionality would be a good addition to the control, you could create an item in our Ideas & Feedback Portal and if it receives enough votes, our developers team will consider implementing it in one of our future releases.


    Regards,
    Konstantin Dikov
    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.

     
Back to Top