How to publish an interactive video in a mobile application?

François Legrand -

Use a webview to publish an interactive video in a mobile application. The following code detects when the webview is ready to receive the content and ask for loading the publication URL in the web view : http://play.adways.com/experience/xxxxxx (you have to replace xxxxxx by your publication ID).

  

iOS (Swift) :

   override func viewDidLoad() {

       super.viewDidLoad()

       self.webView.delegate = self;

       self.webView.keyboardDisplayRequiresUserAction = true

       self.webView.frame = self.view.frame;

       self.webView.allowsInlineMediaPlayback = true

      

       let url = NSURL(string:"http://play.adways.com/experience/xxxxxxx")

       let req = NSURLRequest(URL:url!)

       self.webView!.loadRequest(req)

   }

  

Android (Java) :

protected void onCreate(Bundle savedInstanceState) {

   super.onCreate(savedInstanceState);

   setContentView(R.layout.activity_main);

 

   mWebView = (WebView) findViewById(R.id.webView);

 

   WebSettings webSettings = mWebView.getSettings();

   webSettings.setJavaScriptEnabled(true);

   mWebView.setWebChromeClient(new WebChromeClient());

 mWebView.loadUrl("http://play.adways.com/experience/xxxxxxx");

}

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk