[英]In an array of Objects, how do I return all Objects by property in React?
[英]JS - Ooyala API: How do I return this objects title property?
我正在使用Ooyala API( http://www.ooyala.com/support/docs/player_api )嵌入視頻,並希望隨着視頻的變化而動態地更改標題。
我使用以下代碼在html中嵌入了視頻;
<script src="http://www.ooyala.com/player.js?width=750&height=312&embedCode=dwbjp-XdAc-w6mATLnMIuwBRxHfF5vRK"></script>
然后,在js文件中,我可以使用重新加載播放器;
document.getElementById('player').setQueryStringParameters({embedCode:'pzcDAxMTrAKV8Y7ClV7VbyLZE6kY4Q8d',autoplay:'1'});
當API提供getCurrentItemTitle時,我認為這就像將這個屬性分配給var並像這樣再次將其吐出一樣容易。
$title = document.getElementById('player').getCurrentItemTitle;
..但是,這似乎不起作用。 :(
有任何想法嗎?
非常感謝,
巴里
您是否嘗試過在最后加上括號?
$title = document.getElementById('player').getCurrentItemTitle();
doh ..當然是一個函數..so需在末尾附加(。),只要在我的tod上找出所有內容即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.