Re: [android-developers] Problem with video in WebView

2012-06-13 Thread vaibs malviya
i think your solution is in this line
*iframe width=\1100px\ height=\1500px\ src=\
http://www.youtube.com/embed/g6-8zkbCjl8\; frameborder=\0\
allowfullscreen*
there is a  *allowfullscreen* so try to remove or replace it by other.

On Tue, Jun 12, 2012 at 10:03 PM, Angélica Oliveira
angelica@gmail.comwrote:

 Thank you very much! I could watch the video with this code.

 The only problem is that the video only appears when I watch it on
 fullscreen mode.

 Why is that happening? Anyone knows?

 I am testing it on Samsung Galaxy Tab.

 Thank's in advance again!


 2012/6/9 vaibs malviya vaibs.malviy...@gmail.com

 hy
 Deniz is correct, u should create your on custom view of web-view
 let me explain u ,see my code
 implement this code and check it out.



 *public class TestYoutubeVedio extends Activity *
 *{*
 *
 *
 *HtmlvVido mWebView;*
 *   *
 *   *
 *  *
 *  *
 *   *
 *
 *
 *@Override*
 *public void onCreate(Bundle savedInstanceState)*
 * {*
 *super.onCreate(savedInstanceState);*
 * *
 *mWebView = new HtmlvVido(this);*
 *
 *
 *if (savedInstanceState != null) *
 *{*
 *mWebView.restoreState(savedInstanceState);*
 **
 **
 *} else*
 *{*
 *String Play = htmlbody bgcolor=+#00+iframe
 width=\1100px\ height=\1500px\ src=\
 http://www.youtube.com/embed/g6-8zkbCjl8\; frameborder=\0\
 allowfullscreen/iframe/body/html;  *
 *  *
 **
 *}*
 *  *
 *setContentView(mWebView.getLayout()); *
 *  *
 *}*
  *
 *
 *@Override*
 *public void onSaveInstanceState(Bundle outState) *
 *{*
 **
 *super.onSaveInstanceState(outState);*
 *mWebView.saveState(outState);*
 *   *
 *  *
 *}*
 *
 *
 *@Override*
 *public void onStop() *
 *{*
 **
 *super.onStop();*
 **
 *mWebView.stopLoading();*
 *}*
 **
 *}*

 *create ur custom web-view *


 *public class HtmlvVido extends WebView*
 *{*
 *
 *
 *private Context mContext;*
 *private MyWebChromeClient   mWebChromeClient;*
 *private ViewmCustomView;*
 *private FrameLayout mCustomViewContainer;*
 *private WebChromeClient.CustomViewCallback  mCustomViewCallback;*
 *
 *
 *private static FrameLayout mContentView;*
 *private FrameLayout mBrowserFrameLayout;*
 *private FrameLayout mLayout;*
 * *
 *FrameLayout COVER_SCREEN_PARAMS1;*
 *
 *
 *   *
 *static final String LOGTAG = HTML5WebView;*
 *
 *
 *@SuppressWarnings(deprecation)*
 * private void init(Context context) *
 *{*
 *mContext = context; *
 *Activity a = (Activity) mContext;*
 *
 *
 *mLayout= new FrameLayout(context);*
 *   *
 * *
 *  *
 *  *
 **
 *  *
 *
 *
 *mBrowserFrameLayout = (FrameLayout)
 LayoutInflater.from(a).inflate(R.layout.custum, null);*
 * *
 **
 *  *
 *mContentView = (FrameLayout)
 mBrowserFrameLayout.findViewById(R.id.main_content);*
 *mCustomViewContainer = (FrameLayout)
 mBrowserFrameLayout.findViewById(R.id.fullscreen_custom_content);*
 *
 *
 *mLayout.addView(mBrowserFrameLayout,COVER_SCREEN_PARAMS);*
 *   *
 **
 *
 *
 *// Configure the webview*
 *WebSettings s = getSettings();*
 *s.setBuiltInZoomControls(true);*
 *
 s.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);*
 *s.setUseWideViewPort(true);*
 *s.setLoadWithOverviewMode(true);*
 *  //  s.setSavePassword(true);*
 *s.setSaveFormData(true);*
 *s.setJavaScriptEnabled(true);*
 *  *
 *mWebChromeClient = new MyWebChromeClient();*
 *setWebChromeClient(mWebChromeClient);*
 *
 *
 *setWebViewClient(new WebViewClient());*
 *
 *
 *setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);*
 *
 *
 *// enable navigator.geolocation *
 *   // s.setGeolocationEnabled(true);*
 *   //
 s.setGeolocationDatabasePath(/data/data/org.itri.html5webview/databases/);
 *
 *
 *
 *// enable Web Storage: localStorage, sessionStorage*
 *   // s.setDomStorageEnabled(true);*
 *
 *
 *mContentView.addView(this);*
 *}*
 *
 *
 *public HtmlvVido(Context context) *
 *{*
 *super(context);*
 *init(context);*
 *}*
 *
 *
 *public HtmlvVido(Context context, AttributeSet attrs) {*
 *super(context, attrs);*
 *init(context);*
 *}*
 *
 *
 *public HtmlvVido(Context context, AttributeSet attrs, int defStyle)*
 *{*
 *super(context, attrs, defStyle);*
 **
 *   *
 **
 *init(context);*
 *}*
 *
 *
 *public FrameLayout getLayout() *
 *{*
 **
 *return mLayout;*
 *}*
 *
 *
 *public boolean 

Re: [android-developers] Problem with video in WebView

2012-06-12 Thread Angélica Oliveira
Thank you very much! I could watch the video with this code.

The only problem is that the video only appears when I watch it on
fullscreen mode.

Why is that happening? Anyone knows?

I am testing it on Samsung Galaxy Tab.

Thank's in advance again!

2012/6/9 vaibs malviya vaibs.malviy...@gmail.com

 hy
 Deniz is correct, u should create your on custom view of web-view
 let me explain u ,see my code
 implement this code and check it out.



 *public class TestYoutubeVedio extends Activity *
 *{*
 *
 *
 *HtmlvVido mWebView;*
 *   *
 *   *
 *  *
 *  *
 *   *
 *
 *
 *@Override*
 *public void onCreate(Bundle savedInstanceState)*
 * {*
 *super.onCreate(savedInstanceState);*
 * *
 *mWebView = new HtmlvVido(this);*
 *
 *
 *if (savedInstanceState != null) *
 *{*
 *mWebView.restoreState(savedInstanceState);*
 **
 **
 *} else*
 *{*
 *String Play = htmlbody bgcolor=+#00+iframe
 width=\1100px\ height=\1500px\ src=\
 http://www.youtube.com/embed/g6-8zkbCjl8\; frameborder=\0\
 allowfullscreen/iframe/body/html;  *
 *  *
 **
 *}*
 *  *
 *setContentView(mWebView.getLayout()); *
 *  *
 *}*
 *
 *
 *@Override*
 *public void onSaveInstanceState(Bundle outState) *
 *{*
 **
 *super.onSaveInstanceState(outState);*
 *mWebView.saveState(outState);*
 *   *
 *  *
 *}*
 *
 *
 *@Override*
 *public void onStop() *
 *{*
 **
 *super.onStop();*
 **
 *mWebView.stopLoading();*
 *}*
 **
 *}*

 *create ur custom web-view *


 *public class HtmlvVido extends WebView*
 *{*
 *
 *
 *private Context mContext;*
 *private MyWebChromeClient   mWebChromeClient;*
 *private ViewmCustomView;*
 *private FrameLayout mCustomViewContainer;*
 *private WebChromeClient.CustomViewCallback  mCustomViewCallback;*
 *
 *
 *private static FrameLayout mContentView;*
 *private FrameLayout mBrowserFrameLayout;*
 *private FrameLayout mLayout;*
 * *
 *FrameLayout COVER_SCREEN_PARAMS1;*
 *
 *
 *   *
 *static final String LOGTAG = HTML5WebView;*
 *
 *
 *@SuppressWarnings(deprecation)*
 * private void init(Context context) *
 *{*
 *mContext = context; *
 *Activity a = (Activity) mContext;*
 *
 *
 *mLayout= new FrameLayout(context);*
 *   *
 * *
 *  *
 *  *
 **
 *  *
 *
 *
 *mBrowserFrameLayout = (FrameLayout)
 LayoutInflater.from(a).inflate(R.layout.custum, null);*
 * *
 **
 *  *
 *mContentView = (FrameLayout)
 mBrowserFrameLayout.findViewById(R.id.main_content);*
 *mCustomViewContainer = (FrameLayout)
 mBrowserFrameLayout.findViewById(R.id.fullscreen_custom_content);*
 *
 *
 *mLayout.addView(mBrowserFrameLayout,COVER_SCREEN_PARAMS);*
 *   *
 **
 *
 *
 *// Configure the webview*
 *WebSettings s = getSettings();*
 *s.setBuiltInZoomControls(true);*
 *s.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
 *
 *s.setUseWideViewPort(true);*
 *s.setLoadWithOverviewMode(true);*
 *  //  s.setSavePassword(true);*
 *s.setSaveFormData(true);*
 *s.setJavaScriptEnabled(true);*
 *  *
 *mWebChromeClient = new MyWebChromeClient();*
 *setWebChromeClient(mWebChromeClient);*
 *
 *
 *setWebViewClient(new WebViewClient());*
 *
 *
 *setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);*
 *
 *
 *// enable navigator.geolocation *
 *   // s.setGeolocationEnabled(true);*
 *   //
 s.setGeolocationDatabasePath(/data/data/org.itri.html5webview/databases/);
 *
 *
 *
 *// enable Web Storage: localStorage, sessionStorage*
 *   // s.setDomStorageEnabled(true);*
 *
 *
 *mContentView.addView(this);*
 *}*
 *
 *
 *public HtmlvVido(Context context) *
 *{*
 *super(context);*
 *init(context);*
 *}*
 *
 *
 *public HtmlvVido(Context context, AttributeSet attrs) {*
 *super(context, attrs);*
 *init(context);*
 *}*
 *
 *
 *public HtmlvVido(Context context, AttributeSet attrs, int defStyle)*
 *{*
 *super(context, attrs, defStyle);*
 **
 *   *
 **
 *init(context);*
 *}*
 *
 *
 *public FrameLayout getLayout() *
 *{*
 **
 *return mLayout;*
 *}*
 *
 *
 *public boolean inCustomView() {*
 *return (mCustomView != null);*
 *}*
 *
 *
 *public void hideCustomView() {*
 *mWebChromeClient.onHideCustomView();*
 *}*
 *
 *
 *@Override*
 *public boolean onKeyDown(int keyCode, KeyEvent event) {*
 *if (keyCode == KeyEvent.KEYCODE_BACK) {*
 *if 

Re: [android-developers] Problem with video in WebView

2012-06-09 Thread Angélica Oliveira
I tried playing .mp4 video, from my internal storage.

I saw something about implement onShowCustomView but I didn't realize what
I have to do, can you (Deniz) give me an example?

I already searched it on google, but I didn't find anything, I would like
to watch the video on the webview, not in a VideoView...

Thank's!

2012/6/7 Narendra Singh Rathore nsr.curi...@gmail.com

 Are you sure, your device supports swf file, or you have proper
 plugin/player for it?
 May be that's the problem.


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-09 Thread vaibs malviya
hy
Deniz is correct, u should create your on custom view of web-view
let me explain u ,see my code
implement this code and check it out.



*public class TestYoutubeVedio extends Activity *
*{*
*
*
*HtmlvVido mWebView;*
*   *
*   *
*  *
*  *
*   *
*
*
*@Override*
*public void onCreate(Bundle savedInstanceState)*
* {*
*super.onCreate(savedInstanceState);*
* *
*mWebView = new HtmlvVido(this);*
*
*
*if (savedInstanceState != null) *
*{*
*mWebView.restoreState(savedInstanceState);*
**
**
*} else*
*{*
*String Play = htmlbody bgcolor=+#00+iframe
width=\1100px\ height=\1500px\ src=\
http://www.youtube.com/embed/g6-8zkbCjl8\; frameborder=\0\
allowfullscreen/iframe/body/html;  *
*  *
**
*}*
*  *
*setContentView(mWebView.getLayout()); *
*  *
*}*
*
*
*@Override*
*public void onSaveInstanceState(Bundle outState) *
*{*
**
*super.onSaveInstanceState(outState);*
*mWebView.saveState(outState);*
*   *
*  *
*}*
*
*
*@Override*
*public void onStop() *
*{*
**
*super.onStop();*
**
*mWebView.stopLoading();*
*}*
**
*}*

*create ur custom web-view *


*public class HtmlvVido extends WebView*
*{*
*
*
*private Context mContext;*
*private MyWebChromeClient   mWebChromeClient;*
*private ViewmCustomView;*
*private FrameLayout mCustomViewContainer;*
*private WebChromeClient.CustomViewCallback  mCustomViewCallback;*
*
*
*private static FrameLayout mContentView;*
*private FrameLayout mBrowserFrameLayout;*
*private FrameLayout mLayout;*
* *
*FrameLayout COVER_SCREEN_PARAMS1;*
*
*
*   *
*static final String LOGTAG = HTML5WebView;*
*
*
*@SuppressWarnings(deprecation)*
* private void init(Context context) *
*{*
*mContext = context; *
*Activity a = (Activity) mContext;*
*
*
*mLayout= new FrameLayout(context);*
*   *
* *
*  *
*  *
**
*  *
*
*
*mBrowserFrameLayout = (FrameLayout)
LayoutInflater.from(a).inflate(R.layout.custum, null);*
* *
**
*  *
*mContentView = (FrameLayout)
mBrowserFrameLayout.findViewById(R.id.main_content);*
*mCustomViewContainer = (FrameLayout)
mBrowserFrameLayout.findViewById(R.id.fullscreen_custom_content);*
*
*
*mLayout.addView(mBrowserFrameLayout,COVER_SCREEN_PARAMS);*
*   *
**
*
*
*// Configure the webview*
*WebSettings s = getSettings();*
*s.setBuiltInZoomControls(true);*
*s.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);*
*s.setUseWideViewPort(true);*
*s.setLoadWithOverviewMode(true);*
*  //  s.setSavePassword(true);*
*s.setSaveFormData(true);*
*s.setJavaScriptEnabled(true);*
*  *
*mWebChromeClient = new MyWebChromeClient();*
*setWebChromeClient(mWebChromeClient);*
*
*
*setWebViewClient(new WebViewClient());*
*
*
*setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);*
*
*
*// enable navigator.geolocation *
*   // s.setGeolocationEnabled(true);*
*   //
s.setGeolocationDatabasePath(/data/data/org.itri.html5webview/databases/);
*
*
*
*// enable Web Storage: localStorage, sessionStorage*
*   // s.setDomStorageEnabled(true);*
*
*
*mContentView.addView(this);*
*}*
*
*
*public HtmlvVido(Context context) *
*{*
*super(context);*
*init(context);*
*}*
*
*
*public HtmlvVido(Context context, AttributeSet attrs) {*
*super(context, attrs);*
*init(context);*
*}*
*
*
*public HtmlvVido(Context context, AttributeSet attrs, int defStyle)*
*{*
*super(context, attrs, defStyle);*
**
*   *
**
*init(context);*
*}*
*
*
*public FrameLayout getLayout() *
*{*
**
*return mLayout;*
*}*
*
*
*public boolean inCustomView() {*
*return (mCustomView != null);*
*}*
*
*
*public void hideCustomView() {*
*mWebChromeClient.onHideCustomView();*
*}*
*
*
*@Override*
*public boolean onKeyDown(int keyCode, KeyEvent event) {*
*if (keyCode == KeyEvent.KEYCODE_BACK) {*
*if ((mCustomView == null)  canGoBack()){*
*goBack();*
*return true;*
*}*
*}*
*return super.onKeyDown(keyCode, event);*
*}*
*
*
*private class MyWebChromeClient extends WebChromeClient *
*{*
*private Bitmap  mDefaultVideoPoster;*
*private ViewmVideoProgressView;*
*
*
*@Override*
*public void onShowCustomView(View view,
WebChromeClient.CustomViewCallback callback)*
*{*
*

Re: [android-developers] Problem with video in WebView

2012-06-07 Thread Amit Gupta
I tried playing .swf video. video in 
http://www.in.com/videos/watchvideo-cnbc-awaaz-1626397.html  plays well in 
browser but not in webview.


On Thursday, 7 June 2012 13:55:58 UTC+8, Narendra Singh Rathore wrote:


 Please clarify, which video format are you trying to display.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-07 Thread abhijeet tomar
I think , the video tag is not supportedwhy are you not using VideoView
for playing video?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-07 Thread Deniz Tuna
You have to implement onShowCustomView and also onHideCustomView in your 
own webChromeClient class. After that you can view videos by clicking on 
them. However autoplay tag seems like not working with android from what i 
tried. Searching for google for how to view html5 video in android will 
take you to the answer. Good luck 
3 Haziran 2012 Pazar 22:02:21 UTC+3 tarihinde Angélica yazdı:

 Hello, 

 I am new in android, and I am developing an app, where I want to watch a 
 movie in a webview, using HTML 5, but the video doesn't appear, when I run 
 the app I can see only the video controls... 

 The code in html that I am using is:

 code = !DOCTYPE html +

   html +

   head +

   titleSimple Movie Player/title +

   /head +

   body +

   video src=\+ uri.toString() + \ +

controls +

   /video +

   /body +

   /html;

 The uri is from a video in the internal storage. I load this html code in 
 a webview by this command:

  webview.loadDataWithBaseURL(null, code, null, utf-8, null);

 Can anyone help me? I am trying very hard to do this!


 Thanks in advance,

 Angelica




 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-07 Thread Narendra Singh Rathore
Are you sure, your device supports swf file, or you have proper
plugin/player for it?
May be that's the problem.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-06 Thread Narendra Singh Rathore
Please clarify, which video format are you trying to display.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem with video in WebView

2012-06-04 Thread Amit Gupta
I am also facing the same issue.

Regards,

Amit Gupta




On Mon, Jun 4, 2012 at 3:02 AM, Angélica Oliveira angelica@gmail.comwrote:

 Hello,

 I am new in android, and I am developing an app, where I want to watch a
 movie in a webview, using HTML 5, but the video doesn't appear, when I run
 the app I can see only the video controls...

 The code in html that I am using is:

 code = !DOCTYPE html +

   html +

   head +

   titleSimple Movie Player/title +

   /head +

   body +

   video src=\+ uri.toString() + \ +

controls +

   /video +

   /body +

   /html;

 The uri is from a video in the internal storage. I load this html code in
 a webview by this command:

  webview.loadDataWithBaseURL(null, code, null, utf-8, null);

 Can anyone help me? I am trying very hard to do this!


 Thanks in advance,

 Angelica




  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en