How to stop Quicktime movie in web page from auto loading? - html

I have two quicktime movie files embedded in one web page. I have set autoplay="false" to prevent them both from playing at the same time, but they still load at the same time. Can I prevent them from loading until the user clicks the play button?
autohref="false" is supposed to do this but it does not seem to work.
Apple's documentation for the EMBED element

[BEGIN EDIT - 2010/03/30]
The problem here, I think, is that there is no control to modify buffering behavior. The AutoHREF parameter refers to preloading the value of an href parameter (or perhaps an HREF embedded in the video itself?), not to buffering the video.
I'm currently using a modification of this technique on some pages and Javascript with Modernizr to dynamically insert different video embeds depending on browser support.
I transcode my video to ogg/theora/vorbis like this with VLC (on a Mac; it's very similar for *nix) with 1024kbps bitrate for video and 128kbps bitrate for audio:
/Applications/VLC.app/Contents/MacOS/VLC \
--rc-fake-tty -I dummy \
${original_video} \
':sout=#transcode{vcodec=theora,vb=1024,acodec=vorbis,ab=128,audio-sync}:standard{mux=ogg,dst=${ogg_file},access=file}' vlc://quit
And to transcode to MP4/H.264/AAC (same bitrates) (assuming VLC supports M4A/AAC audio):
/Applications/VLC.app/Contents/MacOS/VLC \
--rc-fake-tty -I dummy \
${original_video} \
':sout=#transcode{vcodec=mp4v,vb=1024,acodec=mp4a,ab=128}:standard{mux=mp4,dst=${m4v_file},access=file}:sout-transcode-soverlay=0' vlc://quit
(Using the original, high-quality video would be best, but this should work for any format VLC can decode.)
Just for giggles, I also use the HTML5 audio element, when available, and here's how I transcode an mp3 to ogg/vorbis (using lame and vorbis-tools) at 128kbps (VBR) and high quality:
lame --decode ${mp3_file} - \
| oggenc -r -b 128 -q 9 -o ${ogg_file} -
And mp3 to m4a/AAC (using lame and faac):
lame --decode ${mp3_file} - \
| faac -w -s -o ${m4a_file} -
(Of course using the original raw PCM/WAV would be better.)
(IANAL, but:) It's important to note that both H.264 and AAC are under patent (and licensing is exorbitant). There are some fears that Theora may be subject to so-called submarine patents, but it and Vorbis appear to be unencumbered currently.
[END EDIT]
Did you find an answer to this? I'm seeing the same behavior. (I've been assuming that parameter/attribute names are not case-sensitive, as even the Apple docs inconsistently use various case schemes.)
In case there's any confusion, I think what the original questioner (and I) wants is for the Quicktime movie not to be downloaded at all until the user clicks the "play" button. I have several videos on the same page, and it's unlikely that the user will watch them all; I don't want them downloaded until they're explicitly requested. The "autohref" parameter is supposed to ensure this behavior when set to "false", but at least in Firefox 3.6 with Quicktime plugin 7.6.3 on Mac OS 10.6.2, it doesn't appear to work.
<object
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
width="332"
height="184"
id="video-0"
>
<param name="src" value="video/sony-ps3.mov" />
<param name="AllowEmbedTagOverrides" value="True" />
<param name="AutoPlay" value="False" />
<param name="AllowEmbedTagOverrides" value="True" />
<param name="AutoPlay" value="False" />
<param name="AutoHREF" value="False" />
<param name="EnableHREF" value="False" />
<param name="EnableJavascript" value="True" />
<param name="ShowLogo" value="False" />
<param name="Volume" value="60" />
<param name="wmode" value="transparent" />
<embed
width="332"
height="184"
src="video/sony-ps3.mov"
type="video/quicktime"
pluginspage="www.apple.com/quicktime/download"
name="video-0"
AllowEmbedTagOverrides="True"
AutoPlay="False"
AutoHREF="False"
EnableHREF="False"
EnableJavaScript="True"
ShowLogo="False"
Volume="60"
wmode="transparent"
></embed>
</object>

I haven't tried this yet but maybe it will work it's the first thing listed autohref="false"
http://web.mac.com/studybuddys/iWeb/studybuddys/12%20Multimedia_files/06%20Apple%20QT%20Embed%20Tag%20Attributes.pdf
I'm trying to do this for audio (not have it load till the play button is clicked) but i don't have an href value all I have is a src value
ps - I just noticed in your original posting that you said autohref="false" is supposed to do this but doesn't work
I guess I'll just add that I just have a src value and no href value i am trying to find the same answer but with audio

It depends on how you embed the QuickTime movies. But it should respect the autoplay flag. Just putting it in tagswill work, but I think it's not the correct way to do it. Have you done it like the code below?
<object width="160" height="144"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="sample.mov">
<param name="autoplay" value="false">
<param name="controller" value="false">
<embed src="sample.mov" width="160" height="144"
autoplay="false" controller="false"
pluginspage="http://www.apple.com/quicktime/download/">
</embed>
</object>
Update
Or do you mean the movies do not play on page load, but both start playing when the user interacts with one of them? If the latter is the case it would probably be better to set a placeholder image which a user can click and then load the appropriate content, instead of loading both applets at the same time. Doing it like this takes less resources, because the end user machine would only have to load the QuickTime plugin once a user has activated a particular movie.

Related

Raspberry Pi RTSP steam in browser

I have set up a RTSP stream from my raspberry pi camera module using this:
raspivid -o - -t 9999999 |cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
I am able to view it using VLC with: rtsp://192.168.0.18:8554/
When I attempt to embed the video in a web page the video does not show.
<!DOCTYPE html>
<html><body>
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="800" height="600" id="vlc" events="True">
<param name="Src" value="rtsp://192.168.0.18:8554/" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed id="vlcEmb" type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"
target="rtsp://192.168.0.18:8554/" ></embed>
</OBJECT>
</body></html>
What is the best way to embed the video feed in HTML to view it in a web browser?
Well this is a bit tricky - when you open the RTSP link directly with VLC it should work since VLC comes packed with all the codecs (in your case H264). However I'm not aware of what happens with the browser plugin - does it reuse the codecs from the VLC installation or what. It could be that a codec is simply missing on the viewer's end but I'm not sure about that. Also, using the plugin you could run into issues with support among different browsers and whatnot.
The html5 video thing is a bit sketchy since as far as I remember (and this may have changed) neither live H.264 nor WebM is fully supported across all browsers. I'd still go with WebM since Chrome and Firefox has it and only IE requires an add-on. Check this question, it has a valid WebM streaming command line in the response and see if that works for you. If it does you should be even able to omit all the embed stuff and just use a plain HTML5 video tag.

How to play an AVI file in a video tag?

I'm wondering if it's possible to make a browser play a AVI file within a video tag.
Everything I found on the web talking about it focus on MP4 and Ogg formats but nobody talks about the AVI format.
The only solution I found is to drop the video tag and make the video playable using JW Player.
Only the DivX web player can stream avi files. actually, theres a plug in for vlc to stream avi files also, but its buggy.
Sometimes it's a pain in the ass to get a solid answer. its one of the big sucks of the internet.
<object id="ie_plugin" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"
width="660"
height="300"
codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="stage6" />
<param name="autoPlay" value="false" />
<param name="src" value="link-to-avi" />
<param name="bannerEnabled" value="false" />
<embed id="np_plugin" type="video/divx"
src="link-to-avi"
custommode="stage6"
width="660"
height="300"
autoPlay="false"
bannerEnabled="false"
pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
note where it says "link-to-avi" twice :)
Today there are excellent approaches to deal with it. One of them is the module fluent-ffmpeg found on npm.
It requires the previous installation of FFMPEG
The support of avi isn't direct. It will be necessary build a server with node to serve your html.

Showing volume control for embedded MediaPlayer video?

I would think there would be a simple param for embedded videos to show a volume control but I cannot seem to find anything except stuff on controlling the systems volume using jquery. Is there a way to just enable the built in volume control of an embedded video?
If I use this code to embed the video is there a way to enable the volume control of the player?
<object CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="220">
<param name="fileName" value="URL of my Video">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="URL of my video" width=220 autoStart=0 showcontrols=1>
</object>
yes there is. and apparently you added it for two players. i dunno whether the parametes are correct, but this embedding teqnique is really out of date and will not be supported for as many clients as video could be.
you should check out the html5 video tag, the next best alternative (imo) is flash.
have a look at this article: http://camendesign.com/code/video_for_everybody

How do you dynamically load different streaming F4V files into one SWF player?

I need to figure out how to utilize one SWF player/file to load different streaming F4V files dynamically.
As it stands now, I have:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="500" height="314" id="something" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/images/flash/' . $video . '" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="/images/flash/' . $video . '" quality="high" bgcolor="#ffffff" width="500" height="314" name="something" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
Currently I am publishing a separate SWF player/file for each F4V, but this is unacceptable. I need to use one SWF file to load different F4V files. I'm not that knowledgeable in the ways of Flash, but I believe that the "src" attribute of the embed tag and the "name='movie'" attribute of the object's param tag needs to point to the SWF player/file. So does anybody know how I can manipulate the object and embed tags to make them load a different F4V file into the SWF player?
Well since nobody responded it was up to me to continue my search for the answer to this one. I modified a solution taken from: http://www.webdeveloper.com/forum/showthread.php?t=185784 by infinityspiral.
It requires you to add the following line of code to the SWF player/file.
FLVPlayerInstanceName.play(this.loaderInfo.parameters.file);
After doing this and uploading it to your web server, you can access FlashVars. The one I needed to access was "file" and I simply had to feed it an rtmp call (such as "rtmp://yourserver.vod/mp4:Whatever.f4v") once in a param tag inside the object tag and once as an attribute inside the embed tag and it worked.
There does appear to be a bug with the version of Flash Media Server I'm using though... You need to be careful what directory you're putting your F4V files in on your streaming server until Adobe corrects the issue (so I had to fiddle with my rtmp call above by removing a directory level inside the call to get it to work).

Meaning of attributes and parameters in HTML Flash tag?

In the below code, what are all the parameters and attributes used, why are all these used and what's their meaning here?
What parameters and attributes are recommended and what are not to use with a Flash tag in a HTML page?
<object id="vf_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="630" height="400">
<param name="movie" value="/videos/swf/3fun.swf" />
<param name="FlashVars" value="id=72" />
<param name="allowScriptAccess" value="always" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<embed name="vf_flash" src="/videos/swf/3fun.swf" FlashVars="id=72" width="630" height="400" allowScriptAccess="always" loop="false" menu="false" quality="high" wmode="window" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
The Adobe website has clear and concise explanations of all of these tags, including which are optional and which are required.
http://kb2.adobe.com/cps/127/tn_12701.html
Out of order, and based on memory. Verify these all before use, but it should help you wrap your head around the concepts:
In the fight for monopoly over the web, Microsoft has committed to differ from the W3C whenever possible. Therefore, the actual tag used to embed Flash in Internet Explorer is 'object', in all real browsers it's 'embed'.
It must be noted that using '1' and '0' will give you better overall consistency than 'true' and 'false', due to this fight.
loop - tells whether or not the Flash player should attempt to restart the movie when it finishes playing it.
FlashVars - parameters can be passed into Flash, and are referred to through the flashvars unit. For example, if you create a media player that plays song1 you may pass in Flashvars="song1=song1"
movie - the URL of the Flash file. Keep it in the same folder as the HTML file calling it, or use an absolute URL or you will hit a cross-browser issue.
quality - the higher the quality the more resources Flash requires to run. While the default is good, if you are worried that the player will be used on older computers, sometimes sacrifice image quality for the sake of a less jumpy experience
wmode - the background opacity of the movie. Sometimes you want the movie to blend in with the background, and it gets set to "transparent", sometimes it should clearly be its own little box, "opaque". Note here that there are some easter eggs with this value, if you need it, there are some undocumented options for this value.
allowScriptAccess - I actually thought this was deprecated. It changed a lot in different versions. Leave this on default.
Libraries like Mootools have classes designed for working with Flash and JavaScript together.
Take a look here and here for the articles on A List Apart (ALA) on the embed vs object tags, there is a lot to be learned from it.
The one's that I can answer off the top of my head:
"movie" - the name of the flash file to load/view
"loop" - whether the animation plays once (false) or repeats (true)
"menu" - whether to show the full context menu (true) or not (false). Setting this to false shows the context menu, but it only has the "settings" and "about" options.
See Kane Wallmann's link for the full documentation.