2012-08-23 39 views
0

我已經完成了使用sencha的應用程序,使用手機間隙構建我打包了這些文件。現在我可以在啓動應用程序時顯示splash.png圖像。但我需要在啓動應用程序時向用戶顯示啓動視頻。所以我添加了源圖像路徑添加視頻路徑沒有得到飛濺的視頻。我想知道關於是sencha touch2支持飛濺視頻還是不行?如果它支持意味着它將支持哪種類型的視頻格式。任何人都可以告訴我如何在sencha touch2中實現這一個。如何在sencha touch2中啓動應用程序時顯示啓動視頻

這裏是開機畫面代碼:Config.xml中(工作)

<?xml version="1.0" encoding="UTF-8" ?> 
    <widget xmlns = "http://www.w3.org/ns/widgets" 
     xmlns:gap = "http://phonegap.com/ns/1.0" 
     id  = "com.phonegap.example" 
     versionCode="10" 
     version = "1.0.0"> 
    <!-- versionCode is optional and Android only --> 
    <name>ABC</name> 
<gap:splash src="resources/splash/def.png" width="1024" height="768" /> 
<gap:splash src="resources/splash/def.png" gap:platform="android" gap:density="ldpi" /> 
<icon src="resources/icons/xyz.png" gap:platform="ios" width="80" height="80" /> 
<icon src="resources/icons/xyz.png" gap:platform="android" gap:density="ldpi" width="100" height="100"/> 
</widget> 

這裏是飛濺視頻編碼:config.xml中(不工作)

<?xml version="1.0" encoding="UTF-8" ?> 
    <widget xmlns = "http://www.w3.org/ns/widgets" 
     xmlns:gap = "http://phonegap.com/ns/1.0" 
     id  = "com.phonegap.example" 
     versionCode="10" 
     version = "1.0.0"> 
    <!-- versionCode is optional and Android only --> 
    <name>ABC</name> 
<gap:splash src="resources/splash/AVIFile.avi.mp4" width="1024" height="768" /> 
<gap:splash src="resources/splash/AVIFile.avi.mp4" gap:platform="android" gap:density="ldpi" /> 
<icon src="resources/icons/xyz.png" gap:platform="ios" width="80" height="80" /> 
<icon src="resources/icons/xyz.png" gap:platform="android" gap:density="ldpi" width="100" height="100"/> 
</widget> 

回答

1

刪除在Phonegap或Sencha中給出的飛濺圖像。現在,通過使用IFRAME或html5視頻標籤將視頻添加到index.html文件中;爲您使用的標籤提供一個ID。

現在,通過Sencha launch函數中的ID訪問元素,並將其從DOM中刪除。你應該得到你想要的。

+0

嗨,我已經按照你所說的完成了。在索引文件中,我添加了html5視頻標籤並給出了視頻文件的sourch路徑。在啓動功能,我正在訪問視頻標籤的ID和稱爲功能play();但它顯示視頻的海報不玩。下面我已經給出了代碼,你可以告訴我我在代碼中犯了什麼錯誤**索引代碼** **'

'** –

+0

**啓動代碼** **'launch:function(){ var myVideo = document.getElementById(「video1」); this.myVideo.play();'** –

+0

我在safari控制檯中出現這樣的錯誤**'undefined'不是函數(評估'myVideo.play()')** –

相關問題