गोरान ने एपीआई संदर्भ पोस्ट किया है। मैं इसे जांचने की सिफारिश करता हूं। यद्यपि आप जो खोज रहे हैं उसके लिए यहां कुछ बुनियादी कोड दिया गया है। मैं मुख्य भागों टिप्पणी की है:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
//this function gets called when the player is ready
function onYouTubePlayerReady (playerId) {
ytplayer = document.getElementById("myytplayer");
console.log(ytplayer);
}
//generic seekTo function taking a player element and seconds as parameters
function playerSeekTo(player, seconds) {
player.seekTo(seconds);
}
</script>
<div id="ytapiplayer">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
<br/>
<a href="#" onclick="playerSeekTo(ytplayer, 70); return false;">Link to 1 minutes 10 seconds</a>
<a href="#" onclick="playerSeekTo(ytplayer, 90); return false;">Link to 1 minutes 30seconds</a>
<a href="#" onclick="playerSeekTo(ytplayer, 110); return false;">Link to 1 minutes 50 seconds</a>
अब js:
var ytplayer;
$(document).ready(function() {
swfobject.embedSWF("//www.youtube.com/e/Py_IndUbcxc?enablejsapi=1&playerapiid=ytplayer &version=3",
"ytapiplayer", // where the embedded player ends up
"425", // width
"356", // height
"8", // swf version
null,
null, {
allowScriptAccess: "always"
}, {
id: "myytplayer" // here is where the id of the element is set
});
});
Here बेला है कि मैं बनाया है।
मदद के लिए धन्यवाद! हालांकि, मैं इसे काम करने के लिए प्रतीत नहीं कर सकता। क्या आप शायद एक जेएसफिल्ड प्रदान कर सकते हैं? धन्यवाद! – bookcasey
@bookcasey मैंने मूल उत्तर में कोड अपडेट किया है और एक कामकाजी पहेली शामिल है। अगर आपका कोई प्रश्न हैं, तो मुझे से पूछें। – sinemetu1
जो लोग फ़ायरफ़ॉक्स का उपयोग करते हैं, बेवकूफ़ टूट नहीं जाता है, केवल अलग विंडो में परिणाम देखने पर वीडियो प्रदर्शित करता है। – lulalala