i have a video link that is in iframe i want to get alert when video will ended. i am doing something like this
var vid = document.getElementById("viddler-videoid");
vid.ended = function() {
alert("code here");
};
<iframe id="viddler-videoid" src="//www.viddler.com/embed/videoid/?f=1&autoplay=1&player=mini&make_responsive=0&hideFullScreenControl=true" width="497" height="375" frameborder="0" scrolling="no" allowfullscreen></iframe>
can any one help me for this.
Update:
Actually i am facing browser problem with my old code. previously i am using this code showing below
<object width="497" height="375" id="viddlerOuter-videoId" type="application/x-shockwave-flash" data="//www.viddler.com/mini/videoid/">
<param name="movie" value="//www.viddler.com/mini/videoid/">
<param name="allowScriptAccess" value="always">
<param name="allowNetworking" value="all">
<param name="allowFullScreen" value="true">
<param name="flashVars" value="f=1&autoplay=t&hideablecontrolbar=1&enablecallbacks=t&disableseek=1&disablebranding=1&loop=0&nologo=1&hd=1&initialVolume=50">
<object id="viddlerInner-videoid">
<video id="viddlerVideo-videoid" src="//www.viddler.com/file/videoid/html5mobile?openURL=di" type="video/mp4" width="497" height="375" poster="//www.viddler.com/thumbnail/id/" controls="controls" x-webkit-airplay="allow"></video>
</object>
</object>
function playEnded() {
jwplayer('mediaspace').play();
}
this was working fine on firefox and chrome but now this code is running firefox only. in chrome browser video is not playing. that is why i update me video code with iframe. iframe video is running but 2nd video is not play which should be play after ended iframe video.
Related
I have used the following code to play a sound:
<object>
<param name="autostart" value="true">
<param name="src" value="bgmusic.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed id="hidden-embed" src="bgmusic.mp3" controller="true" volume="1" autoplay="true" autostart="True" type="audio/mpeg" hidden="true" loop="true" />
</object>
The mp3 is being played in a notmal html page. However when putting the same tags in a jsp page its not being played. Any suggestions would be of great help.
I want to create a video player which is able to play these video files:
'mpg':
'mov':
'wmv':
'rm':
'3g2':
'3gp':
'm4v':
'mp4':
'asf':
'asx':
'avi':
'flv':
'srt':
'swf':
'vob':
The videos will be used in an online exam as some questions may require watching a video for information. The video needs to work on all major browsers. Be able to work on computer or ipad.
My question is what is the best way for me to create a html video player?
Do I go for the HTML5 + object + embed method (sample):
<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">
<object data="movie.mp4" width="320" height="240">
<embed src="movie.swf" width="320" height="240">
</object>
</video>
To include the other file types do I just include more <embed> tags to support those files?
Or is the best way by using the Youtube player which is this:
IFRAME:
<iframe width="420" height="345"
src="http://www.youtube.com/embed/XGSy3_Czz8k">
</iframe>
OR
SHOCKWAVE:
<embed
width="420" height="345"
src="http://www.youtube.com/v/XGSy3_Czz8k"
type="application/x-shockwave-flash">
</embed>
I saw this example on SO as well but not sure if it is good to use or not:
<object id='tempVid1' name="emQTPlayer" height="240px"
width="320px" style="behavior: url(#BinaryBehaviorID)"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
<param name="autoplay" value="false" />
<param name="src"
value="" />
<param name="controller" value="true" />
<param name="type" value="video/quicktime" />
<param name="align" value="bottom" />
<param name="border" value="0" />
<param name="scale" value="tofit" />
<%-- <param name="wmode" value="transparent">--%>
<param name="showcontrols" value="true">
<embed id='tempVid2' name="emQTPlayer" type="video/quicktime"
autoplay="false" height="auto" width="auto" align="top"
border="0" controller="true" postdomevents="true"
pluginspage="http://www.apple.com/quicktime/download/"
showcontrols="true" scale="tofit"
src='' />
</object>
MORE INFO here: http://www.w3schools.com/html/html_videos.asp
Most of the formats in your list wont work on all platforms. Some will require plugins that are only available on particular platforms.
You will need to convert to h.264 mp4 files + one other (ogg or webm, unless you can use flash to play the mp4 files).
You can do this yourself, or use something like Zencoder to do it for you.
I'm trying to write a simple regex that will locate object tags and ignore any matches that contain the words "youtube or "youtu.be".
I've tried
<object .*?>.+?(?=youtube|youtu\.be).+?<\/object>
Which successfully locates object tags WITH those words in them, but the converse does not work and instead just returns all object matches.
<object .*?>.+?(?!youtube|youtu\.be).+?<\/object>
Any idea what I'm missing here?
EDIT:
It has to look through a source similar to:
fdgfdgfdg
<object width="560" height="315">
<param name="movie" value="http://www.youtube.com/v/-F_ke3rxopc?version=3&hl=en_US">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/-F_ke3rxopc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true">
</embed>
</object>
fdgfdgdg
<object width="400" height="300">
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=31589401&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" />
<embed src="http://vimeo.com/moogaloop.swf?clip_id=31589401&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300">
</embed>
</object>
fdgdgg
Then pick out object blocks that do not contain the words so than I can run a replace on them.
a valid but not perfect regex would be:
<object.*>.*(youtube|youtu\.be).*<\/object>
btw. http://www.rubular.com/ is a nice website to check regular expressions
My Site is: http://butplaygames.com
Here is the code i am putting in my footer right before the body tag:
<script type='text/javascript'>
<!--
(function(i,w,d,p,c,e,s,t){t=d.getElementsByTagName('script');if(!w[i]){w[i]={ads:[]};s=d.createElement('script');s.src='http'+(d.location.protocol=='https:'?'s://server':'://cdn')+'.cpmstar.com/cached/js/global_v100.pack.js';s.type='text/javascript';s.async='';t[0].parentNode.insertBefore(s,t[0]);}
p['poolid'] = myidherewhichiput;
c['background'] = null;
c['close'] = null;
c['type'] = 'game';
w[i].ads.push({params:p,config:c,events:e,overlay:-1,s:t[t.length-1]});})('cpmstar',window,document,{},{},{});
//-->
</script>
My game embed code for flash:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="800" height="600" id="TreasureTrash">
<param name="movie" value="MYURL" />
<embed src="MYURL" allowfullscreen="true" allowScriptAccess="always" wmode="opaque" width="800" height="600" name="TreasureTrash" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
<param name="allowfullscreen" value="true" />
<param name="wmode" value="opaque">
</embed></object>
The code works in Firefox, Chrome and Opera. But not in IE. Kindly help. I am very lost here. My site is butplaygames.
An AD is supposed to show over my flash games using the javascript code. It shows in Opera, Firefox and Chrome. But does not show in IE. IE does not even show any errors. It just makes the entire swf into a small dot and does nothing.
The script needs to read the .swf from the src atribute. In your case, in the src atribute there is no .swf there.
PROBLEM: when i press play the audio starts but the video does not.
CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JW Player for Flash</title>
</head><body>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("player","9.0.98","expressInstall.swf");
</script>
<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="468" height="262">
<param name="movie" value="player-licensed.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=Bioshphere-Museum-of-Water.flv&image=preview.jpg" />
<object type="application/x-shockwave-flash" data="player-licensed.swf" width="468" height="262">
<param name="movie" value="player-licensed.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=video.flv&image=preview.jpg" />
<p>Get Flash to watch this video.</p>
</object>
</object>
</body>
</html>
LIVE EXAMPLE: http://solomongiles.com/mediamar/readme.html
Solutions?
Use the script found here, http://www.walkernews.net/2008/01/11/how-to-embed-flv-flash-in-wordpress-or-html/, with new player. It works in IE. I've also added allowfullscreen="true" allowsscriptaccess="always" after the size parameters. Plays in IE but no full screen. Help with this if you can please.
Works fine here in mac/safari 4.0.3.
However I do notice one thing - your flashvars for the object and param bits don't match up. They should be the same.
Also, you make want to look into a more flexible embedding solution such as SWFObject (it helps you do player detection and will let your document validate as XHTML as well)
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="640" height="480"><param name="flashvars" value="file=http://www.webiste.com/admin/php_uploads/video.flv&image=imgs/image_large.jpg" /><param name="movie" value="flvplayer/player.swf" /><embed src="flvplayer/player.swf" width="640" height="480" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=http://www.webiste.com/admin/php_uploads/video.flv&image=imgs/image_large.jpg" /></object>