Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 23, 2019 12:23 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: how do you use youtube player API
PostPosted: Thu Mar 10, 2011 9:29 pm 
Offline

Joined: Thu Mar 10, 2011 9:00 pm
Posts: 1
I know youtube movie control by YouTube JavaScript Player API.
I know realbasic web edition support youtube Controller and with ExecuteJavaScript.
I want know how do I use YouTube JavaScript Player API in real basic.

example html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
<title>YouTube movie sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--▼A Use the Google AJAX Libraries API: http://code.google.com/apis/ajaxlibs/
SWFObject:http://code.google.com/intl/ja/apis/ajaxlibs/documentation/index.html#swfobject -->
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("swfobject", "2.1");
</script>


<script type="text/javascript">

function onYouTubePlayerReady(playerId) {
//alert(playerId);
if(playerId == "ytplayer1"){
ytplayer1 = document.getElementById("myytplayer1");
}
if(playerId == "ytplayer2"){
ytplayer2 = document.getElementById("myytplayer2");
}
}

//動画コントロール▼B-2
function play1() {
if (ytplayer1) {
ytplayer1.playVideo();
ytplayer1.setVolume(20);
}
}
</script>

</head>
<body onload="setTimeout('play1()',3000)"><!---->
<!--->
<div id="ytapiplayer1">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
<!--▼D SWFObject-->
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer1" };
swfobject.embedSWF("http://www.youtube.com/v/zQ8nsE2XC7k&enablejsapi=1&playerapiid=ytplayer1&rel=0
&color2=0xcd311b",
"ytapiplayer1", "480", "295", "8", null, null, params, atts);
</script>

</body>
</html>


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group