• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Events with media elements control in WCF

 

Close():-  

Used to close the opened video/audio file that is being played within the media Element control

 

Pause():-

Used to stop the playing of a video/ audio at current position

 

Play():-

Used  to play the video/audio file that is attached to media element

 

Stop():-

used to stop the playing of video / audio file & Reset the position to the beginning

 

Events with media element control:-

 

Media opened:-

This event will be fixed after loading the video/audio file into the media element control

 

Media Embed:-

This event will be fixed when playing of video/audio file completes

 

EG with Media Element:-

Screenshot_12

Create a new window

Create a media element:
select media element
Go to properties window
Type the file bar in source property
i.e. D:\\videos\sample.

Run the application & check
Media element control in supported in following OS windows 7, window vistall ( service pack)

Media Element Internally will take support of windows media player and to work with media element windows. Media player version should be 10,10.0 version and above ren version of windows media player will not work on media element

 

 

Customizing media element
Create a new window and
write the following code
design the window
Private void binplay_click()
{
Media element/. Play():
{
Private void btn pause_click()

 

Screenshot_13

 

{
Mediaelement 1. Powse();
}
Private void btnstop_click()
{
media elemnt.Stop();
}Private void btn forward –click()
{
Media element1. Position = mediaelemnt1. Position+timespan.fromseconds(2);
}
Private void then backword – click()

{
Media element1. Position = Media Elemtn. Position – Timespan. Fromseconds(2):

}

 

Hider control:-

This control is used to display some numeric data and will provide increment and decrement of values by moving the slide bar left right or top/bottom

 

Properties:-

Minimum:-

used to set the least value from where the slides should start (0) + [Default value]

 

Maximum:

Used to set the highest value upto where the slides control can be used or increased – 10 [default value]

 

Tick frequently :-

used to set a value by which slides value can be increased / decreased when user clicks on .1 [default]

 

 Value:-

used to set /get current position for the slides.

– – > [default]

 

Orientation:-

used to set the required orientation when horizontal slides is displayed like

 

Screenshot_14

 

 

Default event of slider control is value changer. This event will we fired when the value within slides changes

 

Previous diagram:-

Private void media element 1 – media opened()
{
Media element.volume = slidesi-value;
}
private void slides 1_vakye chanes(-)
{
Media element1. Value= slider 1. Value;
}

 

Mute button:-

Private void button mute_click(–)
{
Media Element 1. Value =0;
}

Open:-

Add reference to system . windows forms names pace and write the following.

Using system. Windows. Forms;
private void butn open_click(-)
{
Open file Dialog op = new  openfile dialog();
op. filter = “wnu files|*.wmv|mpu files|*mpg| all files|*.*;

OP.showdialog();
uri obj 1 = new ori(op . filemenu:
media element 1. Source = Obj1;
}

 

Summary
Review Date
Reviewed Item
Events with media elements control in WCF
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Events with media elements control in WCF"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.