一點點上下文。我希望能夠以編程方式控制來自JavaScript的Amazon Instant Video上的Silverlight視頻播放器。如何使用javascript暫停/播放/尋找Silverlight視頻
使用開發者控制檯。我在DOM中找到了視頻播放器元素。
<div id="player_container" style="display: block;">
<object type="application/x-silverlight"
data="data:application/x-silverlight,"
id="player_object"
width="50%"
height="100%">
<param name="color" value="#ffffff">
<param name="background" value="#000000">
<param name="minRuntimeVersion" value="5.1">
<param name="autoUpgrade" value="false">
... elided several <param>'s here ...
</object>
</div>
我再進入在JS REPL在開發者控制檯以下:
> var silver = document.getElementById("player_object");
我再試圖跟隨instructions found here。其中指出我應該
> silver.content.findName(SOMETHING_HERE);
我不能確定使用什麼SOMETHING_HERE,所以我下載Silverlight應用程序與
wget http://www.amazon.com/gp/video/streaming/silverlightPlayer.xap?ie=UTF8&version=104.0-0
unzip silverlightPlayer.xap?ie=UTF8
然後我看在解壓縮AppManifest.xaml:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ExternalCallersFromCrossDomain="ScriptableOnly" EntryPointAssembly="Amazon.ATVSilverlightPlayer" EntryPointType="Amazon.ATVSilverlightWebPlayer.App" RuntimeVersion="5.0.61118.0">
<Deployment.Parts>
<AssemblyPart x:Name="Amazon.ATVSilverlightPlayer" Source="Amazon.ATVSilverlightPlayer.dll" />
<AssemblyPart x:Name="Amazon.AIV.Utilities" Source="Amazon.AIV.Utilities.dll" />
<AssemblyPart x:Name="Amazon.Common" Source="Amazon.Common.dll" />
<AssemblyPart x:Name="AmazonPlayer.Themes.DarkGray" Source="AmazonPlayer.Themes.DarkGray.dll" />
<AssemblyPart x:Name="AtvAdsManager" Source="AtvAdsManager.dll" />
<AssemblyPart x:Name="ATVQos" Source="ATVQos.dll" />
<AssemblyPart x:Name="Microsoft.Logging.LocalConnection" Source="Microsoft.Logging.LocalConnection.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Core" Source="Microsoft.SilverlightMediaFramework.Core.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Diagnostics" Source="Microsoft.SilverlightMediaFramework.Diagnostics.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Logging" Source="Microsoft.SilverlightMediaFramework.Logging.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Plugins" Source="Microsoft.SilverlightMediaFramework.Plugins.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Plugins.Monitoring" Source="Microsoft.SilverlightMediaFramework.Plugins.Monitoring.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Plugins.Progressive" Source="Microsoft.SilverlightMediaFramework.Plugins.Progressive.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Plugins.SmoothStreaming" Source="Microsoft.SilverlightMediaFramework.Plugins.SmoothStreaming.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Plugins.TimedText" Source="Microsoft.SilverlightMediaFramework.Plugins.TimedText.dll" />
<AssemblyPart x:Name="Microsoft.SilverlightMediaFramework.Utilities" Source="Microsoft.SilverlightMediaFramework.Utilities.dll" />
<AssemblyPart x:Name="Microsoft.Web.Media.SmoothStreaming" Source="Microsoft.Web.Media.SmoothStreaming.dll" />
<AssemblyPart x:Name="Newtonsoft.Json" Source="Newtonsoft.Json.dll" />
<AssemblyPart x:Name="System.Json" Source="System.Json.dll" />
<AssemblyPart x:Name="System.Xml.Linq" Source="System.Xml.Linq.dll" />
<AssemblyPart x:Name="System.ComponentModel.Composition" Source="System.ComponentModel.Composition.dll" />
<AssemblyPart x:Name="System.Xml.Serialization" Source="System.Xml.Serialization.dll" />
<AssemblyPart x:Name="System.ComponentModel.Composition.Initialization" Source="System.ComponentModel.Composition.Initialization.dll" />
<AssemblyPart Source="de/Amazon.ATVSilverlightPlayer.resources.dll" />
<AssemblyPart Source="en-GB/Amazon.ATVSilverlightPlayer.resources.dll" />
<AssemblyPart Source="ja/Amazon.ATVSilverlightPlayer.resources.dll" />
<AssemblyPart Source="de/System.Json.resources.dll" />
<AssemblyPart Source="ja/System.Json.resources.dll" />
<AssemblyPart Source="de/System.Xml.Linq.resources.dll" />
<AssemblyPart Source="ja/System.Xml.Linq.resources.dll" />
<AssemblyPart Source="de/System.ComponentModel.Composition.resources.dll" />
<AssemblyPart Source="ja/System.ComponentModel.Composition.resources.dll" />
<AssemblyPart Source="de/System.Xml.Serialization.resources.dll" />
<AssemblyPart Source="ja/System.Xml.Serialization.resources.dll" />
<AssemblyPart Source="de/System.ComponentModel.Composition.Initialization.resources.dll" />
<AssemblyPart Source="ja/System.ComponentModel.Composition.Initialization.resources.dll" />
</Deployment.Parts>
</Deployment>
使用silver.content.findName(SOMETHING_HERE)
時,我試着用SOMETHING_HERE
代替了.xaml文件中x:Name
的許多值。總是返回null。我想得到一個句柄,讓我播放/暫停/從我自己的JavaScript控制檯尋找亞馬遜即時視頻?我應該如何取得成功?
我還爲引用這個資源。 http://slvideoplayer.codeplex.com/discussions/208231 –