Vote count:
0
I was wondering if anybody could help me, I'm using the Buto web video player (http://get.buto.tv/) and I have it working to play one video, but I'd like it so that I can dynamically use my code to play more than one video.
<html>
<head>
<script type="text/javascript">
(function(d, conf) {
var b = d.createElement('script');
b.setAttribute('async', true);
b.src = 'http://ift.tt/1q3KK3U' + conf.object_id;
if (b.addEventListener) {
b.addEventListener('load', function() {
if (window.buto) buto.addPlayer(conf);
}, false);
} else if (b.readyState) {
b.onreadystatechange = function() {
if (window.buto) buto.addPlayer(conf);
};
}
var s = d.getElementsByTagName('script')[0];
s.parentNode.insertBefore(b, s);
}
)(document, {object_id: 'abc', element_id: 'buto_player', width:180, height:115});
</script>
</head>
<body>
<div id='buto_player' style="margin: 1px;"></div>
</body>
</html>
The code that obviously tells JS/buto what to play is:
(document, {object_id: 'abc', element_id: 'buto_player', width:180, height:115})
How can I without copying and pasting the code all the time use for other videos? I presume I'd use a different div id for each div but what about the JS? surely I can't just call (document, {object_id: 'abc', element_id: 'buto_player', width:180, height:115}) again but with a different ID? Or would Javascript allow that?
asked 31 secs ago
Aucun commentaire:
Enregistrer un commentaire