I'm making website and I need to add video, but not using iframe
. Video tag doesn't have this ability I guess, maybe there are some simple alternatives?
Asked
Active
Viewed 3,775 times
1
-
1I think so, but you need to use a `javascript` solution, which acts as a wrapper - something like this might work : http://mediaelementjs.com/examples/?name=youtube – Nick R Jan 17 '14 at 16:33
-
i think this may answer your question http://stackoverflow.com/questions/5157377/show-youtube-video-source-into-html5-video-tag – Auzi Jan 17 '14 at 20:33
1 Answers
0
Have you tried this code ?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>HTML5 MediaElement - YouTube</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://mediaelementjs.com/js/mejs-2.13.1/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="http://mediaelementjs.com/js/mejs-2.13.1/mediaelementplayer.min.css" />
</head>
<body>
<h1>MediaElementPlayer.js</h1>
<h2>YouTube Wrapper</h2>
<video width="640" height="360" id="player1">
<!-- Pseudo HTML5 -->
<source type="video/youtube" src="http://www.youtube.com/watch?v=nOEw9iiopwI" />
</video>
<span id="player1-mode"></span>
<script>
$('video').mediaelementplayer({
success: function(media, node, player) {
$('#' + node.id + '-mode').html('mode: ' + media.pluginType);
}
});
</script>
</body>
</html>
More info at http://mediaelementjs.com

Pedro Lobito
- 94,083
- 31
- 258
- 268