Video playing in ASP.Net page - asp.net

I want to play video in my asp.net page. I am using the code
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player1" width="440" height="379">
<param name="URL" value="~/DBVideo/citibank.mpeg">
<param name="http://">
<param name="AutoStart" value="1">
<param name="ShowControls" value="">
<param name="ShowStatusBar" value="1">
<param name="ShowDisplay" value="1">
<param name="stretchToFit" value="1">
<param name="volume" value="32" />
<embed runat="server" id="Video"
type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="440" height="379" src="~/DBVideo/citibank.mpeg"
filename="~/DBVideo/citibank.mpeg" autostart="1" showcontrols="1" showstatusbar="1" showdisplay="1">
</embed>
</object>
Now only the media player symbol is coming but the video is not playing.
Can anybody help me where the problem is??
and if I want to play the video from SQL server 2008 database (varbinary field) then what would I do?

If you're allowed to use HTML5, you can use video tag
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
<source src="movie.webm" type="video/webm">
Your browser does not support the video tag.
</video>
As for getting video from sql: you can use http handler which extracts file from SQL and probably caches it http://msdn.microsoft.com/en-us/library/46c5ddfy%28v=vs.100%29.aspx

Related

how to hide a video before playing?

I am using the following to put a video on a wordpress site:
<param name="src" value="http://www.mywebsite.com/announcement.mov">
<param name="autoplay" value="true">
<param name="type" value="video/quicktime" height="560" width="950">
<embed src="http://www.mywebsite.com/announcement.mov" height="560" width="950" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">
The part I don't like about this is that you can see the opening frame of the video whenever you are on the page. I would like it if there was a way to make it show just black or show a blank screen until you click the play button.
You would want to use a video placeholder as described in this thread on Stack Overflow: How to add a splash screen/placeholder image for a YouTube video
One point of consideration: If jQuery/JavaScript fails, the video won't load either.
Update
In your HTML:
<img class="video-placeholder" src="placeholder.jpg" data-video="http://www.mywebsite.com/announcement.mov">
In your JS file:
$('.video-placeholder').click(function(){
var video = '<param name="src" value="' + $(this).attr('data-video') + '">
<param name="autoplay" value="true">
<param name="type" value="video/quicktime" height="560" width="950">
<embed src="' + $(this).attr('data-video') + '" height="560" width="950" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">';
$(this).replaceWith(video);
});

video only play in Internet Explorer not in other browser

![In other broeser][2]
[2]: http://i.stack.imgur.com/hSDJB.png code is <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="480" height="360"
codebase="http://www.microsoft.com/Windows/MediaPlayer/">
<param name="Filename" value="hilo_data_final.wmv" />
<param name="AutoStart" value="true" />
<param name="ShowControls" value="true" />
<param name="BufferingTime" value="2" />
<param name="ShowStatusBar" value="true" />
<param name="AutoSize" value="true" />
<param name="InvokeURLs" value="false" />
<embed src="hilo_data_final.wmv" type="application/x-mplayer2"
autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0"
width="480" height="360"></embed>
So what will be problem?
Here you try to use the Windows Media Player to play the video. This is play only on IE and only on computers with windows and media player installed.
Is better to use some flash-base video player (like YouTube do) and then you have more computers and browser that be able to see it.
One suggestion is the flowplayer that I have test it and is very good.
http://flowplayer.org/

How can I embed the swf file into asp page?

I am using the following code but it does not work:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="540" height="400" hspace="10">
<param name=movie value="http://servername/foldername/file.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="C:\Users\SAINI\Desktop\online\spn_20Dec\vp\images\abc.swf"
width="540" height="400" hspace="10" loop="false"
quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash">
</embed>
</object>
How can I do that?
Internet Explorer, Google Chrome, Apple safari, Mozila Firefox and ...
you need a code which work in all of them and there it is:
<object width="900" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="myMovieName" >
<param name="src" value="YOUR MOVIE ADDRESS HERE.swf" />
<param name="quality" value="autohigh" />
<param name="bgcolor" value="black" />
<param name="autostart" value="true" />
<param name="FlashVars" value="init=yes&check=true" />
<param src="flash/movie.swf" autostart="true" flashvars="init=yes&check=true"
quality="autohigh" bgcolor="#000000" name="myMovieName"/>
</object>
All you need to do is:
copy and paste this code into your project,
change the address to your clip address,
change the dimensions of clip (in first line)
Enjoy it!
I've tried your code and it works with me without any alteration except the file and its location. I placed the file inside the root of my website. Sadly it doesn't work when I place another location. I don't know the reason yet
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="540" height="400" hspace="10">
<param name=movie value="http://servername/foldername/file.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="xx.swf" width="540" height="400" hspace="10" loop="false" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash">
</embed> </object>

Embeded swf file with its external resources to Content asp.net page

Under Visual Studio 2010, I’m developing an asp.net application.
I added a folder to my project called Flash. Under Flash folder I added a swf file with its external resources to run.
The folder content:
1- ScrollingImages.swf file to lunch the flash
2- ScrollingImages.xml file that the swf file uses to read images from thumbnails folder
3-thumbnails folder which content images used by swf file.
I can embed the swf file to html easily using this code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=" ScrollingImages.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
But when I use the same code to embed it to asp.net page I will have a problem that the flash will run but I cannot see the images so the swf file unable to locate the xml file and the folder of the images location and they all in the same folder.
Here is the code I used in the aspx.net content page.
<%# Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Gallary.aspx.cs" Inherits="HabibWebSite.Gallary" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=" ScrollingImages.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</asp:Content>
I also tested it in aspx.net page and I’m getting same result no images appear.
I know that the problem is related to who to embed the swf external resources (the xml file and the images folder) to the aspx.net page but I searched a lot and I could solve it.
Please advise me how solve this problem to make the swf file work OK.
Regards,
To resolve this problem all what I need to add is base attribute to the object tag to direct to the external resources folder.
and the code should be some thing like this:
<object type="application/x-shockwave-flash" data=" Flash/ShefBio/chefs_bio.swf" width="970" height="396">
<param name="movie" value=" Flash/ShefBio/chefs_bio.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="base" value=" Flash/ShefBio/" />
<embed src=" Flash/ShefBio/chefs_bio.swf" quality="high" bgcolor="#000000" width="970" height="396" name="ScrollingImages"
align="middle" allowScriptAccess="sameDomain" base=" Flash/ShefBio/"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Embed Flash in IE not working

i created a small menu in flash that i want to embed into my website. The problem is it works in firefox but not in IE.
Could you help me please i am completely new to Flash
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="540" height="50">
<param name="main" value="/Flash/main.swf" />
<param name="play" value="true"/>
<param name="loop" value="true"/>
<param name="scale" value="showall"/>
<param name="wmode" value="window"/>
<param name="menu" value="true"/>
<param name="allowFullScreen" value="false"/>
<param name="allowScriptAccess" value="sameDomain"/>
<param name="quality" value="high" />
<embed height="50" width="540"
align="middle"
type="application/x-shockwave-flash"
salign=""
allowscriptaccess="sameDomain"
allowfullscreen="false"
menu="true"
name="main"
bgcolor="#ffffff"
devicefont="false"
wmode="window"
scale="showall"
loop="true"
play="true"
pluginspage="http://www.adobe.com/go/getflashplayer" quality="high" src="/Flash/main.swf"></embed>
</object>
I can't see what's wrong with your code.
Anyway I strongly suggest you use the swfobject script to embed your flash objects. This will solve the issue that flash objects have to be clicked on in IE before they are played.

Resources