Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Custom Video Player Inside a webview

Hello

I want to be able to open a video player inside a webview.

//Create a web view
var webView = Titanium.UI.createWebView({
    url:'content/index.html'
});

// create a window
var appWin = Titanium.UI.createWindow({
    fullscreen: true
});
appWin.add(webView);
appWin.open();

My video must be a half size of the webview so I could insert a custom panel above it,the panel will contain some buttons that will listen to events.

I tried different ways to achieve this,but still no success.

Any ideas ?

— asked August 25th 2011 by Yan Braslavskiy
  • custom video player
  • embedded video
  • titanium
  • video
  • webview
1 Comment
  • What ways have you tried?

    — commented August 25th 2011 by Matt Apperson

1 Answer

  • I've tried to create a HTML5 video tags inside web Page,but when I click them on iPhone it opens a build in player in full screen,and this is not what I need.On Android HTML5
    embedded video doesn't worked for me at all.

    I've tried to use Titanium "createVideoPlayer" object

    this.activeMovie = Titanium.Media.createVideoPlayer({
    
                url: "",//initialized to nothing by default
    
                backgroundColor:'#111',
    
                scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
                sourceType:Titanium.Media.VIDEO_SOURCE_TYPE_FILE,
                movieControlMode : Titanium.Media.VIDEO_CONTROL_HIDDEN,
                movieControlMode : Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
    
            });
    

    and I tried to nest inside some buttons,and It's the only thing that works for me right now,but it's very inconvenient because I need to fire events back from the webview to
    titaniums listeners.Here I used these techniques
    "CAPTURING EVENTS FROM WEBVIEW TO APP CODE"

    I can't believe Titanium Developers didn't provide some legal ways of creating a custom video player inside a webview.

    — answered August 25th 2011 by Yan Braslavskiy
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.