4

I have created Custom Youtube Player using VideoJS. But I did not find out how can I create custom player to play Dailymotion videos?

I have read everything here but does not get any help. https://developer.dailymotion.com/player

I have tried video.js-dailymotion as @misterben suggest but issue is still there.

My Code

<!DOCTYPE html>
<html>
<head>
<title>Video.js | Dailymotion HTML5 Video Player</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link href="http://vjs.zencdn.net/5.0/video-js.min.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/5.0/video.min.js"></script>
<script src="dailymotion.js"></script>
</head>
<body>
<video id="vid1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="360"
       data-setup='{ "techOrder": ["dailymotion"], "dmControls" : "1", "src": "http://www.dailymotion.com/video/xg3b7m_meetbuck_creation" }'></video>
</body>
</html>

Error in console

TypeError: videojs.MediaTechController is undefined

videojs.Dailymotion = videojs.MediaTechController.extend({

Community
  • 1
  • 1
Muhammad Hassaan
  • 7,296
  • 6
  • 30
  • 50

1 Answers1

5

There is a video.js plugin to play Dailymotion videos along the same lines as the You Tube plugin you must be using. Note this almost certainly will work with video.js version 4 only, not version 5.

https://github.com/benjipott/video.js-dailymotion

misterben
  • 7,455
  • 2
  • 26
  • 47
  • Thank you for your response. I have updated my question. Can you please explain little bit more, – Muhammad Hassaan Nov 22 '15 at 08:55
  • 1
    It doesn't look like the dailymotion plugin has been updated for video.js 5. You'll need to use the v4.x player for that. Try changing the CDN urls to http://vjs.zencdn.net/4.12/... – misterben Nov 23 '15 at 15:14
  • it works on 4xx. Can you please tell how can I show available qualities in player to play? – Muhammad Hassaan Nov 24 '15 at 02:22
  • 1
    There are some video.js rendition selector plugins but I doubt they're compatible with the dailymotion tech. Tbh you're likely to get a better answer to that by asking that on the dailymotion plugin's issue tracker on Github. – misterben Nov 24 '15 at 04:25