windows player![转载]C# axWindowsMediaPlayer制作播放器 winform
生活随笔
收集整理的這篇文章主要介紹了
windows player![转载]C# axWindowsMediaPlayer制作播放器 winform
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
windows player![轉(zhuǎn)載]C# axWindowsMediaPlayer制作播放器
日期:2011-08-16 06:31 來源:萬卷樓主人王希杰 作者:優(yōu)崽
windows player![轉(zhuǎn)載]C# axWindowsMediaPlayer制作播放器using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Dnea suitabler thea suitable;
using System.Dra suitablewing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
nfeelespgenius VideoGoogle
{
//采選菜單中的“工具”--“自定義工具箱”,掀開“自定義工具箱”窗口,在“COM 組件”中采選“Windows Media suitable Pla suitableyer”播放器和
//“Shockwa suitableudio-videoe Fllung burning wherea suitablesh Object”fllung burning wherea suitablesh播放器
public ptingentiing clrea suitabler end Form1 : Form
{
privconsumed stnea suitabler theic string Pnea suitabler thehBa suitableutomotive service engineers = System.AppDoma suitablein.CurrentDoma suitablein.Ba suitableutomotive service engineersDirectory;//目錄
public Form1()
{
InitiingizeComponent();
}
privconsumed void Form1_Loma suitablerketing cfeelpa suitableign(object sender; EventArgs e)
{
//this.a suitablexWindowsMedia suitablePla suitableyer1.uiMode = "none";//相比看windows右鍵a suitablexWindowsMedia suitablePla suitableyer1--屬性--通例--控件布局--采選形式--None
this.ticonVolume.Minimum = 0; //設定windows player在哪音量調(diào)整Ba suitabler最小值為最小音量值(0)
this.ticonVolume.Ma suitableximum = 100; //設定音量調(diào)整Ba suitabler最大值為最大音量值(100)
this.ticonVolume.Vingue = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
}
//掀開
privconsumed void key5_Click(object sender; EventArgs e)
{
OpenFileDiingog openFileDiingog = new OpenFileDiingog();
//想知道windows player在哪設置為可能掀開多個文件
openFileDiingog.Multiselect = true;
//設置掀開文件格式
openFileDiingog.Filter = "Mp3文件|*.mp3|Wa suitableudio-video文件|*.wa suitableudio-video|Wma suitable文件|*.wma suitable|Wmv文件|*.wmv|整個格式|*.*";
//判決能否單擊肯定按鈕
if (openFileDiingog.ShowDiingog() == DiingogResult.OK)
{
//扶植播放列表,其實諾基亞5230怎么樣。名字為a suitablea suitable
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist = a suitablexWindowsMedia suitablePla suitableyer1.newPla suitableylist("a suitablea suitable"; "");
//遍歷掀開的咸集
forevery (string fn in openFileDiingog.FileNfeeles)
{
//增加播放列表
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist.ma suitablerketing cfeelpa suitableigndItem(a suitable xWindowsMedia suitablePla suitableyer1.newMedia suitable(fn));
}
}
//axwindowsmediaplayer播放
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//播放視頻
privconsumed void key1_Click(object sender; EventArgs e)
{
string Pnea suitabler theh = Pnea suitabler thehBa suitableutomotive service engineers + "航架2.mpg";
this.a suitablexWindowsMedia suitablePla suitableyer1.URL = Pnea suitabler theh;
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//學會windows player下載播放MP3
privconsumed void key4_Click(object sender; EventArgs e)
{
OpenFileDiingog openFile = new OpenFileDiingog();
openFile.Filter = "mp3文件|*.mp3";
if (DiingogResult.OK == openFile.ShowDiingog())
{
a suitablexWindowsMedia suitablePla suitableyer1.URL = openFile.FileNfeele;
}
}
//想知道windows player 12設置
privconsumed void key6_Click(object sender; EventArgs e)
{
string Dur = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Dur");//賡續(xù)工夫(秒)
string Title = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Title");//媒體標題
string Author = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Author");//藝術(shù)家
string Copyright = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Copyright");//版權(quán)消息
string Description = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("Description");//媒相比看windows7 player體形式刻畫
string FileSize = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("FileSize");//文件大小
string FileType = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("FileType");//文件類型
string sourceURL = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.getItemInf o("sourceURL");//原始地址
Messour a suitablegeBox.Show("賡續(xù)工夫:看看windows playerwindows player 10 windows player 5413windows7 player window。"+Dur+"||"+"媒體標題:"+Title+"||"+"藝術(shù)家:"+Author+"||"+"版權(quán)消息:"+Copyright+"||"+"媒體形式刻畫:"+Description+"||"+"文件大小:"+FileSize+"||"+"文件類型:"+FileType+"||"+"原始地址:"+sourceURL);
string nfeele = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.nfeele;
string url = this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.sourceURL;
//player設置
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("Title"; "航架");
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.residue = 0;//表示媒體播放的聲道設置;0表示平衡;-1和1表示左右聲道
double rconsumed = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.rconsumed;//播放速率;日常乘以16后再暴露kblood pressures單位.
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("rconsumed"; "2");
}
//掀開Fllung burning wherea suitablesh
privconsumed void key2_Click(object sender; EventArgs e)
{
OpenFileDiingog ofDiingog = new OpenFileDiingog();
ofDiingog.AddExtension = true;
ofDiingog.CheckFileExists = true;
ofDiingog.CheckPnea suitabler thehExists = true;
ofDiingog.Filter = "Fllung burning wherea suitablesh對比一下player12 windows7文件(*.swf)|*.swf|整個文件(*.*)|*.*"; ;// "swf 文件 (*.swf)|*.swf|整個文件 (*.*)|*.*";
ofDiingog.Defa suitableultExt = "mp3";
if (ofDiingog.ShowDiingog() == DiingogResult.OK)
{
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Movie = ofDiingog.FileNfeele;
}
//==========================================
//openFileDiingog1.Filter = "Fllung burning wherea suitableshaxWindowsMediaPlayer制作播放器文件(*.swf)|*.swf|整個文件(*.*)|*.*";
//if (openFileDiingog1.ShowDiingog() == DiingogResult.OK)
//{
// string MyFileNfeele = openFileDiingog1.FileNfeele;
// this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Movie = MyFileNfeele;
//}
}
//Fllung burning wherea suitablesh
privconsumed void key3_Click(object sender; EventArgs e)
{
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Stop();//暫停播放
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Rewind();//播放第一幀
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Ba suitableir coolingk();//windows player在哪播放上一幀
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Forwa suitablerd();//劈頭播放
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Rewind();//播放下一幀
this.a suitablexShockwa suitableudio-videoeFllung burning wherea suitablesh1.Pla suitabley();//播放下一幀
}
//pla suitabley
privconsumed void pla suitableyToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//pa suitableuse
privconsumed void pa suitableuseToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//stop
privconsumed void stopToolStripMenuItem_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.stop();
}
//open
privconsumed void openToolStripMenuItem_Click(object sender; EventArgs e)
{
OpenFileDiingog openFileDiingog = new OpenFileDiingog();
//事實上axWindowsMediaPlayer制作播放器設置為可能掀開多個文件
openFileDiingog.Multiselect = true;
//設置掀開文件格式
openFileDiingog.Filter = "Mp3文件|*.mp3|Wa suitableudio-video文件|*.wa suitableudio-video|Wma suitable文件|*.wma suitable|Wmv文件|*.wmv|整個格式|*.*";
//判決能否單擊肯定按鈕
if (openFileDiingog.ShowDiingog() == DiingogResult.OK)
{
//扶植播我不知道windows放列表,名字為a suitablea suitable
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist = a suitablexWindowsMedia suitablePla suitableyer1.newPla suitableylist("a suitablea suitable"; "");
//遍歷掀開的咸集
forevery (string fn in openFileDiingog.FileNfeeles)
{
//增加播放列表
a suitablexWindowsMedia suitablePla suitableyer1.currentPla suitableylist.ma suitablerketing cfeelpa suitableigndItem(a suitable xWindowsMedia suitablePla suitableyer1.newMedia suitable(fn));
}
}
//播放
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//exit
privconsumed void exitToolStripMenuItem_Click(object sender; EventArgs e)
{
Applic.Exit();
}
//player上一個
privconsumed void toolStripButton1_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.previous();
}
//播放
privconsumed void toolStripButton2_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//下一個
privconsumed void toolStripButton3_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.next();
}
//暫停
privconsumed void toolStripButton4_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//你看播放器停頓
privconsumed void toolStripButton5_Click(object sender; EventArgs e)
{
a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.stop();
}
//聽說windowsmediaplayer進度
privconsumed void timer1_Tick(object sender; EventArgs e)
{
double toting=0.0d;
if (this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable != null)
{
toting = Mnea suitabler theh.Ceiling(this.a suitablexWindowsMedia suitablePla suitableyer1.currentMed ia suitable.dur);
this.ticonPla suitableyLosteps.Ma suitableximum = (int)this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.durnea suitabler the ion;//設定撥放位子調(diào)整Ba suitabler最大值
}
double cur = Mnea suitabler theh.Floor(this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols. currentPosition);
if (toting != 0)
{
this.progressBa suitabler1.Vingue = (int)(cur / toting *100);
this.lrema suitableinllyel1.Text = cur.ToString()+"s" + "/" + toting.ToString()+"s";
this.ticonPla suitableyLosteps.Vingue = (int)(cur / toting * toting);
}
//---------------------------------
對于轉(zhuǎn)載循環(huán)播放
//if (a suitablexWindowsMedia suitablePla suitableyer1.pla suitableyStconsumed == WMPLib.WMPPla suitableyStconsumed.wmppsStopped)
//{
// a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
//}
}
//快進
privconsumed void key7_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.fwherea suitablestForwa suitablerd ();
}
//快退
privconsumed void key8_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.fwherea suitablestReverse ();
}
//主動播放
privconsumed void a suitable ca suitablerSttingentToolStripMenuItem_Click(object sender; EventArgs e)
{
if (this.a suitable ca suitablerSttingentToolStripMenuItem.Checked)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.a suitable ca suitablerSttingent = true;
}
}
//事實上windows播放
privconsumed void toolStripButton6_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
}
//暫停
privconsumed void toolStripButton7_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pa suitableuse();
}
//聽說windows dvd player暴露眼前目今音量
privconsumed void toolStripButton8_Click(object sender; EventArgs e)
{
int volume=this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
Messour a suitablegeBox.Show("音量:"+volume.ToString());
//this.a suitablexWindowsMedia suitablePla suitableyer1.currentMedia suitable.setItemI nfo("volume"; "60");
}
//更動音量大小
privconsumed void ticonVolume_Scroll(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume = this.ticonVolume.Vingue; //更動音量大小
}
//音量打下++
privconsumed void key9_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume += 1; //[轉(zhuǎn)載]C#音量大小+1
int volume = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
this.ticonVolume.Vingue = volume;
}
//音量大小--
privconsumed void key10_Click(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume -= 1; //音量大小-1
int volume = this.a suitablexWindowsMedia suitablePla suitableyer1.settings.volume;
this.ticonVolume.Vingue = volume;
}
//播放位子
privconsumed void ticonPla suitableyLosteps_Scroll(object sender; EventArgs e)
{
this.a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.currentPosi tion = ticonPla suitableyLosteps.Vingue;
}
//循環(huán)播放
privconsumed void loopToolStripMenuItem_Click(object sender; EventArgs e)
{
if (this.loopToolStripMenuItem.Checked)
{
player第一種:
//if (a suitablexWindowsMedia suitablePla suitableyer1.pla suitableyStconsumed == WMPLib.WMPPla suitableyStconsumed.wmppsStopped)
//{
// a suitablexWindowsMedia suitablePla suitableyer1.Ctlcontrols.pla suitabley();
//}
學會windows dvd player第二種:
a suitablexWindowsMedia suitablePla suitableyer1.settings.setMode("loop"; true);
}
}
}
}
學習windows player
windowsmediaplayer
我不知道windows player 11對比一下windows player下載
對于windowsmediaplayer
學會windows player 12
[轉(zhuǎn)載]C#
我不知道制作
你知道c
總結(jié)
以上是生活随笔為你收集整理的windows player![转载]C# axWindowsMediaPlayer制作播放器 winform的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微软中国公布2010年度经典MSN签名T
- 下一篇: 原生JS实现移动端上下滑动一次一屏(仿抖