neilgee
neilgee

Reputation: 538

Problems setting up mediaelement.js

I cant seem to get mediaelement.js running on a simple page, I have followed the set up instructions but the video is still used in its native state, mediaelement doesn't fire.

The javascript and css and jquery are all linking correctly but its not working.

Any ideas?

http://3letterit.com/manual/media.php

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Manwell Pages</title>
    <script src="build/jquery.js"></script>
    <script src="build/mediaelement-and-player.min.js"></script>
    <link rel="stylesheet" href="build/mediaelementplayer.css" />
    <script>
// using jQuery
$('video,audio').mediaelementplayer(/* Options */);</script>

</head>

<body>
<div>           
<video src="http://s3.amazonaws.com/cgp_video/mymovie.mp4" width="320" height="240" controls ></video>
</div>
</body>
</html>

Upvotes: 0

Views: 1707

Answers (1)

yavuzkavus
yavuzkavus

Reputation: 1266

Instead of $('video,audio').mediaelementplayer(/* Options */) use

window.onload = function() {  $('video,audio').mediaelementplayer(/* Options */); };

When you call $('video,audio').mediaelementplayer(/* Options */),

there are not any media elements yet.

Upvotes: 1

Related Questions