Play RingTone in ASP.NET

PLAY RINGTONES/SOUNDS IN ASP.NET



Description


This code is use to play Ringtones in asp.net with play,pause,start button.
you can change it to have the feature with start on load or on play button click.
in the below code it binds one database field ie. RingtonesPath which consists if the path of Ringtones.

Add Namesapces



Imports System
Imports System.Data
Imports System.Data.Sqlclient


Add Connection String



Dim con as new sqlconnection("initial catalog=DatabaseName; Data source=serverName; user id=sa")

Add Below code in HTML File to View Ringtone File




<OBJECT id="player" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
height="122" width="149" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
VIEWASTEXT>
<PARAM NAME="_cx" VALUE="3942">
<PARAM NAME="_cy" VALUE="3228">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE='Ringtones Path'>
<PARAM NAME="Src" VALUE='Ringtones Path'>
<PARAM NAME="WMode" VALUE="Transparent">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="sameDomain">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<embed src='Ringtones Path'
quality="high" bgcolor="#FFFFFF" width="128" height="96" name="player" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</OBJECT>


Add Below code in code behind



Dim com as new sqlcommand("Select Ringtonespath from TableName",Con)
Dim ada as new sqldataadapter(com)
Dim dset as Dataset
ada.Fill(dset)


If u want to play it in datagrid or datalist then bind it



DataList1.Datasource=dset
DataList1.DataBind()



Thanks

Nilesh Jadhav


Comments

Author: ABitSmart30 Nov 2009 Member Level: Gold   Points : 0

Please format your resource.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: