Skip to main content
November 5, 2012
Answered

StageWebView Vimeo ??

  • November 5, 2012
  • 2 replies
  • 5897 views

Ok ,

Using this code to call youtube videos on iOS :

var htmlString:String = "<!DOCTYPE HTML>" +

                        "<html>" +

                            "<body>" +

                                "<iframe class=\"youtube-player\" style=\"border: 0; width: 100%; height: 100%; padding:0px; margin:0px\" id=\"ytplayer\" type=\"text/html\" src=\"http://www.youtube.com/embed/" +

                                "YOUTUBE-ID" + "?fs=0\" frameborder=\"0\">\n" +  "</iframe>\n";

                                  "</body>" +

                        "</html>";

webView.loadString( htmlString, "text/html" );

I started to modify it to call a vimeo video, and i got this:

var stageWebView:StageWebView = new StageWebView();

stageWebView.stage = stage;

stageWebView.viewPort = new Rectangle( 0, 0, 700, 500);

var htmlString:String = "<!DOCTYPE HTML>" +

                        "<html>" +

                            "<body>" +

                                                                                                              "<iframe src=\"http://vimeo.com/VideoID\"  width=\"640\" height=\"480\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>\n";

                            "</body>" +

                        "</html>";

stageWebView.loadString( htmlString, "text/html" );

And the video call perfectly, except for one little thing. THERE ARE NO CONTROLS!!! xD.

So a modified the code to the source call the video like this : http://player.vimeo.com/video/VideoID, that is supose to be the default embed player for iframe on html, and nothing happens.

Now i am trying to get it with moogaloops (swf player for actionscript) but cant still cant get it run.

Any IDEAS!???

thnxs!!

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer

Solved!!

import flash.media.StageWebView;

import flash.geom.Rectangle;

var stageWebView:StageWebView = new StageWebView();

stageWebView.stage = stage;

stageWebView.viewPort = new Rectangle( 0, 0, 700, 500);

var htmlString:String = "<!DOCTYPE HTML>" +

                        "<html>" +

                            "<body>" +

                                                                                "<iframe src=\"http://player.vimeo.com/video/52263761\" width=\"640\" height=\"480\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>\n";

                            "</body>" +

                        "</html>";

stageWebView.loadString( htmlString, "text/html" );

try {Security.allowDomain("*");}catch (e) { };

On Ipad works!!

2 replies

Correct answer
November 6, 2012

Solved!!

import flash.media.StageWebView;

import flash.geom.Rectangle;

var stageWebView:StageWebView = new StageWebView();

stageWebView.stage = stage;

stageWebView.viewPort = new Rectangle( 0, 0, 700, 500);

var htmlString:String = "<!DOCTYPE HTML>" +

                        "<html>" +

                            "<body>" +

                                                                                "<iframe src=\"http://player.vimeo.com/video/52263761\" width=\"640\" height=\"480\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>\n";

                            "</body>" +

                        "</html>";

stageWebView.loadString( htmlString, "text/html" );

try {Security.allowDomain("*");}catch (e) { };

On Ipad works!!

bobsmo
Known Participant
July 25, 2017

SyntaxError: Parse error

https://f.vimeocdn.com/p/2.59.34/js/moogaloop.js : 2

Adobe AnimateCC  ios