forwarding embedded video to a certain place - html

there. I know that there is a possibility to open a video file either using a flash player or html5 in a browser, but is there a possibility to open it at the certain place (lets say 60 seconds from the beginning) or automatically fast forward it after opening? Any code examples would be appreaciated.

Ok, I had to find the answer myself. A similar question was addressed at How do I play just a specific section of a video in a web page?
(but without giving specific examples).
I found out that for flv types you can use flowplayer:
http://flowplayer.org/documentation/scripting.html
My minimal working example:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="flowplayer-3.2.4.min.js"></script>
<title>Minimal Flowplayer setup</title>
</head>
<body>
<div style="display:block;width:520px;height:330px" id="player"> </div>
</body>
<script>
$f("player", "../flowplayer-3.2.5.swf", {
clip: {
url: "four_stroke.flv",
autoPlay: true
},
// you can seek to a certain place of a clip just after that place is already is buffered
onStart:function() {
this.seek(10);
}
});
</script>
</html>
For quicktime movie types you can use quicktime plugin and set start or autoplay parameters to start a video clip at specified place like that:
<PARAM Name="AUTOPLAY" Value="#00:03:15:01" >
or
<PARAM NAME="STARTTIME" VALUE="00:03:15:01" >
more explanations at: http://developer.apple.com/library/mac/#documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/ScriptingHTML.html
Here is my code example that works in my FF3.6 and IE8 (put it in your HTML's body area):
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"
HEIGHT=650
WIDTH=1000
>
<PARAM NAME="src" VALUE="ksetup.mov" >
<PARAM NAME="STARTTIME" VALUE="00:03:00:00" >
<PARAM NAME="AUTOPLAY" VALUE="false" >
<EMBED
SRC="ksetup.mov"
HEIGHT=650 WIDTH=1000
TYPE="video/quicktime"
BGCOLOR=#00ff00
AUTOPLAY="false"
STARTTIME="00:03:00:00"
PLUGINSPAGE="http://www.apple.com/quicktime/download/"
/>
</OBJECT>
Hope this will put someone on track.

Related

Video.js won't play video on IE8

I'm trying to use Video.js 4.11 and after debugging I still couldn't make the video play in IE8 emulation. Strangely, video.js 4.12 version would cause a crash on IE8 emulation and it seems like there is a JSON problem involve the "data-set" tag?
Also, I noticed that even though I designed my own skin for video js, the "border-radius" is been override back to the default value while other things are working good. (my big play button should be a circle but in IE8 emulation, it became a square.)
Just to prove that it's not my video files' problem, I wrote a version based on the Video.js's example and using a lot of their codes but just changed slightly so the appearance would meet my needs.
Everything that I'm referencing locally, I have checked the path and they should be working fine.
Any suggestions and help would be highly appreciate.
Update:
I solved the problem by adding this line of code:
<script src="http://api.html5media.info/1.1.6/html5media.min.js"></script>
Just in case someone had the same problem that their flash fallback is not working on IE8.
Here's my final code for reference:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<title>Video.js demo</title>
<link type="text/css" href="http://vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
<script type="text/javascript" src="http://vjs.zencdn.net/4.11/video.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://api.html5media.info/1.1.6/html5media.min.js"></script>
<style type="text/css">
.vjs-default-skin {color: #F5F2F2;}
.vjs-default-skin .vjs-big-play-button{left:45%;top:40%;border-radius:100%;border-width:0.1em;width:1.8em;height:1.8em;}
</style>
</head>
<body>
<div style="width:700px;margin:0 auto;">
<video id="example" class="video-js vjs-default-skin"
controls preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup='{}'>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
<!-- Flash Fallback. -->
<object type="application/x-shockwave-flash" data="flowplayer-6.0.1/flowplayer.swf" width="854" height="504">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="movie" value="flowplayer-6.0.1/MirandaS1E01.flv">
<!--[if IE8]><param name="movie" value="flowplayer.swf"><![endif]-->
</object>
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that
supports HTML5 video
</p>
</video>
</div>
</body>
</html>

swf file loading with wrong width/height

I have a swf file in an html page. The dimensions of the swf load correctly when I view it in eclipse's web browser, but when I put the file in internet explorer (10?) the outer perimeter of the window is cropped, so that only part of the swf video is visible while it is playing. I want users in a wide variety of browsers to be able to load the video without problems. How can I accomplish this in code?
Here is the code which is causing the problem:
<div style="float:right;display:inline-table;">
<OBJECT classid="clsid:bunchalettersandnumbers" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,28;" WIDTH=616 HEIGHT=490>
<PARAM NAME=movie VALUE="my_vid.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<param name="allowFullScreen" value="true" >
<EMBED src="my_vid.swf" allowfullscreen="true" quality=high bgcolor="#FFFFFF" WIDTH=616 HEIGHT=490 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</div>
EDIT:
As per Aspiro's suggestion, I am using the following code now, but it is still causing the same problem:
<head>
<script type="text/javascript">
swfobject.embedSWF("myvid.swf", "myContent", "700", "550", "9.0.0");
</script>
</head>
<body>
<div id="myContent" style="border: 3px solid #FFCC66;">Some text</div>
</body>
You're not declaring an object type, or wrapping your width and height attributes in quotes.
Check your code against the official manual SWF embed syntax. Here's an example on Adobe's site: http://helpx.adobe.com/flash/kb/object-tag-syntax-flash-professional.html

"Allow" Button for flash content cannot be clicked in Mac Chrome

I'm using Mac Chrome 8.0.552.237
It seems like whenever I embed flash content in html and open it in chrome when my flash content requests camera access and i need to click "allow" button in the dialog it never recognizes the click. It works fine in firefox. I just simply can't understand why it wont work in chrome. I use swfobject, and i used http://www.bobbyvandersluis.com/swfobject/generator/index.html to make the html code just to make sure i wasn't making any mistakes.
any ideas what I could be doing that causes it to not let me click allow?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("MyFlashContent", "10.1.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="800" id="MyFlashContent" align="middle">
<param name="movie" value="MyFlashContent.swf" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="MyFlashContent.swf" width="480" height="800" align="middle">
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
EDIT:
Since it seems like the issue might actually be with my actionscrip code, i'll post how i attached the camera.
var youCam:Camera = Camera.getCamera();
you_cam.attachCamera(youCam);
as you can see I have it attached about as simple as it can get, I actually have this right at the top of my code to place the camera on the stage. This works fine when i test it, and it works fine in firefox.
I have no idea why, but because of the large size of the swf canvas, i learned in chrome i had to click the resize corner of the browser and make the window small and then bring it back to the regular size then it would work. no idea why, but this was only hapening in chrome. i fixed the issue by making the overall size of my swf smaller.
Try setting the css display property to 'inline-block'
I had a similar problem. I was using a swf webcam plugin and, on Chrome 21 only, it was not allowing users to click allow. I ended up fixing it by changing it's css 'display' from 'block' to 'inline-block'.
Hope it helps.
I've had an issue like this before, but it wasn't the browser nor the embedding, it was the example code for enabling the webcam (I think this code even came from the Adobe live docs ffs). The issue was that the camera polling already started, before the allow button was pushed. The polling (some augmented reality experiment) was so heavy, that the allow button only registered the click every 1 in 10 times or so. By putting of the camera polling till after the status-event returned with camera.muted == false, I solved my problem.
Maybe it's worth a try. Cheers, EP
Edit: Code example for the handler
var youCam:Camera = Camera.getCamera();
youCam.addEventListener(StatusEvent.STATUS, handleCameraStatus);
...
private function handleCameraStatus(e:StatusEvent):void {
if (e.code == "Camera.Unmuted") {
you_cam.attachCamera(youCam);
} else if (e.code == "Camera.Muted") {
// display message so the user might try again.
}
}

Flash Embed doesn't work

Please save my skin.
http://clubentertainment.ie/c/art-perf/embed_example.html
The above link should load in Firefox, doesn't load in anything. Doesn't appear to throw any errors. It even validates.
It is using swfobject, all of the links appear to work.. it just isn't actually working. I would like to blame the flash object but as it is working in Firefox the error must be somewhere else.
Any ideas? Is there an alternative way to embed and still have it working?
Furthermore wmode transparency isn't allowing the html dropdown to appear on top of the flash..
Not sure what happens to the bounty - I discovered the problem. The error was definitely with the server. Moved website, changed nothing else. Works just fine. I would just like to thank every one for their help.
I think it is problem with cross domain policy. Try to use relative path url instead of absolute path. You have absolute path now.
When putting the direct link to your swf it works on ie.
http://clubentertainment.ie/c/art-perf/CU3ER.swf
It can be a cross-site problem.
here the code used in CU3ER for demo http://getcu3er.com/features/
<script type="text/javascript">
var vars = { xml_location : '/inc/cu3er/config_features_overview.xml?v=2'};
var params = { wmode:'transparent' };
var attributes = { id:'CU3ER', name:'CU3ER' }; // give an id to the flash object
swfobject.embedSWF("/CU3ER.swf", "cu3er-container", "300", "390", "9.0.45", "/js/expressInstall.swf", vars, params, attributes );
</script>
EDIT:
by just putting your code in the body not the header I got the swf working in ie
<body >
<script type="text/javascript">
// add your FlashVars
var vars = { xml_location : 'http://clubentertainment.ie/c/art-perf/CU3ER-config.xml' };
// add Flash embedding parameters, etc. wmode, bgcolor...
var params = { bgcolor : '#ffffff' };
// Flash object attributes id and name
var attributes = { id:'CU3ER', name:'CU3ER' };
// dynamic embed of Flash, set the location of expressInstall if needed
swfobject.embedSWF('http://clubentertainment.ie/c/art-perf/CU3ER.swf', "CU3ER", 500, 250, "9.0.45", "http://clubentertainment.ie/c/art-perf/js/expressInstall.swf", vars, params, attributes );
// initialize CU3ER class containing Javascript controls and events for CU3ER
// var CU3ER = new CU3ER("CU3ER");
</script>
<!-- CU3ER content HTML part starts here -->
<div id="CU3ER">
<noscript>
<!-- modify this content to provide users without Flash or enabled Javascript with alternative content information -->
<p>Click to get Flash Player<br /><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
<p>or try to enable JavaScript and reload the page
</p>
</noscript>
</div>
<!-- CU3ER content HTML part ends here -->
</body>
I see it not working in Safari 5, but working in Firefox 4. Please try to embed using the SWFObject static publishing method so that you can rule out JavaScript as a potential issue:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>CU3ER</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/c/art-perf/js/swfobject.js"></script>
<script type="text/javascript" src="/c/art-perf/js/CU3ER.js"></script>
<script type="text/javascript">
swfobject.registerObject("cu3er-container", "9.0.45", "/c/art-perf/js/expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="390" id="cu3er-container" class="CU3ER">
<param name="movie" value="/c/art-perf/CU3ER.swf" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<param name="flashvars" value="xml_location=/inc/cu3er/config_features_overview.xml?v=2" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="/c/art-perf/CU3ER.swf" width="300" height="390" class="CU3ER">
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<param name="flashvars" value="xml_location=/inc/cu3er/config_features_overview.xml?v=2" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
You may need to adjust your JavaScript to deal with either the 'cu3er-container' ID or the 'CU3ER' class. In this example, SWFObject is only called in if the version of Flash is insufficient so that it can provide the express installer for rapid upgrade, otherwise this does not require JavaScript.
You can always try to embed flash using valid techniques in XHTML. You can find more about this here: http://latrine.dgx.cz/how-to-correctly-insert-a-flash-into-xhtml
As for swfobject, it seems it has some browser dependant issues. I'll try to figure this out later. I'll keep you posted if I come to any conclusions.
EDIT
Try to use relative paths to your swf file. It worked for me.
The SWF is loading just fine for me in Chrome 5.0.375.125, but the slideshow isn't loading. I suspect this may have to do with differences among how different web browsers are handling Javascript errors.
I enabled script debugging for Internet Explorer (I highly recommend doing this) and opened your page, and I immediately got a Javascript error in what appears to be Flash ExternalInterface calls to Javascript functions defined in CU3ER.js. Sometimes browsers decide to stop running scripts altogether when encountering an error, and some just continue. Firefox is in the "just continue" camp. When clicking "ignore" for errors in IE, IE was able to load images but continued to cause Javascript errors.
The Javascript errors appear to be occurring because CU3ER can't find itself in the DOM. This is based on the fact that this Javascript function call is emitted:
__flash__addCallback(document.getElementById(""), "playCU3ER");
That emitted function is defined like this:
function __flash__addCallback(instance, name) {
instance[name] = function () {
return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
}
}
The fact that document.getElementById was called with an empty string may mean that there's some missing flash variable that CU3ER requires. Check the documentation for the SWF and make sure you have what's required when embedding. Or it could be a relative vs. absolute URL issue as the others have mentioned.

Providing alternative images if Adobe Flash isn't available

Are there any ways providing an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.
I’ve found recommendations, like the following from W3C, which determine via JavaScript the existence of Adobe Flash on the client: W3C Providing alternative images
Honestly, I would prefer a non JS technique. I’m thinking of some XHTML tag, equivalent to <noscript>. (like <noobject> if the object (in our case Flash) can’t be displayed/loaded).
The reason for needing this separation is the following:
The bank I’m working for will preferably display their banners in Flash format. In case it isn’t possible a simple image should be shown.
In the past it was solved very likely in the way mentioned before. We’re currently working on a design refresh and that’s where I stumbled upon this piece of code which makes me wonder if it’s really the most elegant and compatible way of doing so.
Another idea that strikes me: Is it actually possible to load Flash-objects in a JavaScript disabled environment?
Actually having flash installed but javascript turned off is a valid scenario. This should work across most browsers:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="flashContent">
<param name="movie" value="flash.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flash.swf" width="800" height="600">
<!--<![endif]-->
<img src="(...)" alt="Put your alternate content here" />
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
I use the following code for graceful degradation. It works well.
<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="flash.swf" width="500" height="100">
<!-- <![endif]-->
<!--[if IE]>
<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="500" height="100">
<param name="movie" value="flash.swf" />
<!--><!--dgx-->
<param name="loop" value="false">
<param name="menu" value="false">
<param name="quality" value="high">
<img src="flash_replacement.png" width="500" height="100" alt="No Flash">
</object>
<!-- <![endif]-->
I don't know why you want to avoid javascript, it is the best solution when dealing with Flash.
using the SWFObjects Library (the best known so far for the matter) you can do this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> My Home Page </title>
<meta name="viewport" content="width=780">
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div id="splashintro">
<img src="splash_noflash.png" />
</div>
<script type="text/javascript">
var so = new SWFObject("csplash.swf", "my_intro", "300", "240", "8", "#338899");
so.write("splashintro");
</script>
</body>
</html>
what the script does is replace the splashintro div with the flash file, if the browser does not support Flash, then does nothing and the splash_noflash.png will be shown.
P.S. With this technique you are ready for the iPhone, instead of showing the blue cube, it will show the image :)
I find using inline styling to do the trick.
For example:
<div style="background-image: url('...');">
<object>
/* Embedded Flash */
</object>
</div>
We can provide an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.
<object id="flashcontent classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550px" height="400px">
<param name="movie" value="mymovie.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="mymovie.swf" width="550px" height="400px">
<!--<![endif]-->
<p>
Fallback or 'alternate' content goes here.
This content will only be visible if the SWF fails to load.
</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
And also add this...
<script type="text/javascript">
swfobject.registerObject("flashcontent", "9", "/path/to/expressinstall.swf");
</script>
I have written an easy way to do this in CSS - no extra JavaScript at all.
Name your ID/Class where your Flash movie resides and use a background image. Wrap your Flash movie within that div.
For example:
<div ID="MyFlashMovie"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="flashContent">
<param name="movie" value="flashMovie.swf" />... etc., etc.</object>
</div> etc.
Then in your CSS:
#MyFlashMovie {
background: url("alternateGraphic.png");
background-repeat: no-repeat;
height: XXpx;
width: XXpx;
}
When the Flash isn't available, say on the iphone/pad, the graphic will display. The only drawback with this, that I have found, is that if your Flash movie uses a transparent background, you will see the alt graphic through the transitions. Just make a solid color within the Flash movie as your lowest layer (make sure it's the same bg color as the website) and it will look fine.
~GreaseJunkie