articles

Home / DeveloperSection / Articles / Add Videos Player in ASP.NET MVC 4

Add Videos Player in ASP.NET MVC 4

AVADHESH PATEL 27319 06-May-2013

In this article I have described how to play video or embedded player in your web application. For playing video, player’s plugin are required. Plugin install in your browser before video play if plugin not installed. For embedded player Microsoft.Web.Helpers package are required. If Microsoft.Web.Helpers’s references not added in your application then first add Microsoft.Web.Helpers package. Get the help for adding references of Microsoft.Web.Helpers, follow below url

https://www.mindstick.com/Articles/1264/add-reference-of-microsoft-web-helpers-in-mvc-4

Flash Videos

To play flash videos, use the Video.Flash web helper. The path parameter is mandatory and all other parameters are optional. Video can be a local file, or a link to a Youtube video.

@Video.Flash(path: "http://www.youtube.com/embed/pIv6yR9Q1IA", width: "100", height: "200", play: true, loop: true, menu: true, bgColor: "red", quality: "medium", scale: "exactfit", windowMode: "transparent")
Flash Video Parameter Description

path

the path to the video file

width

the width of the video rendered in the web page

height

the height of the video rendered in the web page

play

value that determines if the video will play automatically

loop

value that determines if the video automatically starts upon ending

menu

value that determines if the context menu is visible

bgColor

 the background colour of the helper

quality

the output video quality. Values include low, autolow, autohigh, medium, high, and best

scale

sets the size of the video. Values include exactfit, showall and noorder

windowMode

sets the placement of the video. Values include transparent, window and opaque

  Windows Media Videos 

To play WMV videos, use the Video.MediaPlayer web helper. The path parameter is mandatory and all other parameters are optional. Vedio can be a local file or a remote file.

@Video.MediaPlayer(path: "../Videos/tutorial.wmv", width: "400", height: "200", autoStart: true, playCount: 2, uiMode: "full", stretchToFit: true, enableContextMenu: false, mute: false, volume: 75)

  Windows Media Videos Parameter Description

path

the path to the video file

width

the width of the video rendered in the web page

height

the height of the video rendered in the web page

autoStart

value that determines how many times the video will play automatically

uiMode

Value that determines which controls show up in the user interface. Values include invisible, none, mini, or full

stretchToFit

value that determines if video will stretch to fit the width and height settings

enableContextMenu

value that determines if a context menu appears when right-clicking on the video

mute

self-explanatory

volume

self-explanatory

Silverlight Videos

To play Silverlight videos, use the Video.Silverlight web helper. The path parameter is mandatory and all other parameters are optional.

@Video.Silverlight(path:"../Vedio/tutorial.xap",width:"400",height:"200", bgColor:"red",autoUpgrade:true) 

  Windows Media Videos Parameter Description

path

the path to the video file

width

the width of the video rendered in the web page

height

the height of the video rendered in the web page

bgColor

the background colour of the video

autoUpgrade

value that determines whether or not the control will upgrade to a newer version of Silverlight if available

  


Updated 30-Nov-2017
Avadhesh Kumar Patel District Project Manager - Aligarh 14 months work experience in Panchayati Raj Department Sector as District Project Manager & 12 months work experience in IT Sector as Software Engineer. :-)

Leave Comment

Comments

Liked By