Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Vimeo video does not play in webview, but Youtube works (iframe ans html5)

$
0
0

Vimeo video inside Android webview does not play.

I have the following code which displays:

  • Vimeo
  • Youtube

    For the vimeo the first frame of video shows up but when I hit play either nothing happens, the screen goes grey and shows a film reel, or freezes the app. For Youtube it plays fine.

Does anyone know ( i mean actually has it working in the android app an iframe embeded video that works) how to accomplish this???

In tiapp.xml

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <tool-api-level>17</tool-api-level>
        <manifest>
            <application android:hardwareAccelerated="true"/>
        </manifest>
    </android>
In the app.js
text_in_html = "<html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1\"></head><body><div style=\"font-size: 25pt; zoom: 50%; \" >" + 
                "<iframe src=\"http://player.vimeo.com/video/74429955\" width=\"630\" height=\"354\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"  + 
                "<iframe width=\"640\" height=\"360\" src=\"http://www.youtube.com/embed/BSewdu4ciuk?feature=player_embedded\" frameborder=\"0\" allowfullscreen></iframe>" + 
                "</div></body></html>";
 
                // Create our Webview
                var myWV = Ti.UI.createWebView({
                        html:text_in_html,
                        title:'Title goes here',
                        pluginState:Ti.UI.Android.WEBVIEW_PLUGINS_ON_DEMAND,
                        height:Ti.UI.Fill,
                        width: Ti.UI.Fill,
                        scalesPageToFit:true,
                        left:0,
                        right:0,
                        top:0, 
                        bottom:0, 
                        loading: true   
                });
 
 
                var post_window = Titanium.UI.createWindow({
                    modal : true,
                    backgroundColor : '#fff',
                    width: Titanium.Platform.displayCaps.platformWidth,
                    navBarHidden : true
                });
                post_window.addEventListener('close', function() {
                    myWV.pause();
                    post_window.remove(myWV);
                    myWV = null;
                });
                post_window.add(myWV);
                post_window.open();

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>