using BLL;
using Helper;
using Model;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WEB
{
    public partial class detail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Music m = Session["temp"] as Music;
                MusicBLL bll = new MusicBLL(m.Source);
                if (!bll.GetData(m))
                { m = bll.ReSearch(m, 0.75); }
                lblName.Text = m.Name;
                lblArtist.Text = m.Artist;
                lblAlbum.Text = m.Album;
                //lblUrl.Text = m.Url;
                lblUrl.NavigateUrl = m.Url;
                Response.Write(string.Format("<audio src=\"{0}\"  autoplay=\"autoplay\"></audio>", m.Url));
                picAlbum.ImageUrl = m.PicUrl;
                if (m.Lrc != null)
                {
                    Lyric lrc = m.GetLrc();
                    foreach (LrcWord item in lrc.Words)
                    {
                        lrcView.Items.Add(new ListItem(item.Word, item.Export));
                    }
                }

            }
        }
    }
}