Giter Site home page Giter Site logo

mozilla / shumway Goto Github PK

View Code? Open in Web Editor NEW
3.7K 205.0 396.0 240.49 MB

Shumway is a Flash VM and runtime written in JavaScript

License: Apache License 2.0

Makefile 0.24% ActionScript 33.94% HTML 1.51% JavaScript 21.67% CSS 0.08% Shell 0.03% C 0.38% TypeScript 40.91% C++ 0.85% Python 0.33% Java 0.03% XSLT 0.03%

shumway's Introduction

Build Status

Shumway

Shumway is an HTML5 technology experiment that explores building a faithful and efficient renderer for the SWF file format without native code assistance.

Shumway is community-driven and supported by Mozilla. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering SWFs. Integration with Firefox is a possibility if the experiment proves successful.

Getting started

Online demo

For an online demo, visit:

Extension

Install the Firefox extension: http://mozilla.github.io/shumway/extension/firefox/shumway.xpi

This development extension should be quite stable but still might break from time to time. Also, note that the development extension is updated on every merge and by default Firefox will auto-update extensions on a daily basis (you can change this through the extensions.update.interval option in about:config, time is in seconds).

To build the Firefox extension: use grunt firefox.

Contributing

Development

See the wiki.

If you don't want to hack on the project or have little spare time, you still can help! Just install the Firefox extension, test it on SWFs in the wild, and report any problems or unimplemented features.

Our GitHub contributors so far:

You can add your name to it! :)

The easiest way to get started is to grep for TODOs and implement them.

Additional resources

Talk to us on IRC:

  • #shumway on irc.mozilla.org

Post on our mailing list:

Subscribe either using lists.mozilla.org or Google Groups:

shumway's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shumway's Issues

Calls to gotoAndPlay(x) should not advance the navigation until the frame script completes.

See: example/timeline/Timeline7.swf

Read section on Frame Execution: http://www.senocular.com/flash/tutorials/orderofoperations/

// frame script
trace(currentFrame); // 1
gotoAndStop(5);
trace(currentFrame); // 1

"Specifically, all frame navigation for an instance occurring within the frame scripts of that instance is queued and executed at the end of the call stack. This means the frame does not change directly after a navigation call is made."

issue in class création

[function fn122 () {
Runtime.stack.push($C[0]);
var $SS = $C[147];
var $S = $SS, $O = $S.object, $G = $S.global.object, $S = $SS;
var a;
var s1;
$S = new Scope($S, this, undefined);
$O = $S.object;
// file: E:\admin27_05_2012\src;W\recept;receptBase.as
// line: 23
s1 = $C[4].public$Object;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[49].public$flash$events$EventDispatcher;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[51].public$flash$display$DisplayObject;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[53].public$flash$display$InteractiveObject;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[55].public$flash$display$DisplayObjectContainer;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[57].public$flash$display$Sprite;
$S = new Scope($S, s1, undefined);
$O = $S.object;
/******
*
*$C[95].public$MCM; is undefined
*
*
*
*/
s1 = $C[95].public$MCM;
$S = new Scope($S, s1, undefined);
$O = $S.object;
s1 = $C[5].runtime.createClass($C[149], $C[95].public$MCM, $S);
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$S = $S.parent;
$O = $S.object;
$O.public$W$recept$receptBase = s1;
// file: E:\admin27_05_2012\src;W\recept;receptBase.as
// line: 1
Runtime.stack.pop();
return;
}][0]

package {
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Matrix;
import flash.geom.Matrix3D;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.geom.Vector3D;
import S.E.Ev;
import S.io.console;
import S.T.T;
import W.recept.receptBase;

public class MCM extends Sprite {
.....
}

}

$C[95]

flags 0
id 8459
name "MCM"
qualifiedName "public$MCM"
namespaces[0]{
kind 22
originalURI ""
qualifiedName "public"
uri ""
}


Because $C[95].public$MCM; is undefined shumway fail at :
Erreur : TypeError: baseClass is undefined
Fichier Source : resource://shumway/avm2/domain.js
Ligne : 130

Does not work in Latest Nightly.

I downloaded the whole repo just now, packed the proper files into xpi, installed. Tested on youtube and facebook. The big play button with two button below it giving the option to choose flash and shumway appear. Clicking on either shumway or the big play button blanks the flash area, with a shumway label in bottom right and nothing else. I get these errors in error console :

Timestamp: 1/12/2013 8:38:20 PM
Error: ReferenceError: EXECUTION_MODE is not defined
Source File: resource://shumway/web/viewer.html
Line: 327

Timestamp: 1/12/2013 8:38:20 PM
Error: ReferenceError: enableVerifier is not defined
Source File: resource://shumway/web/avm2utils.js
Line: 1

Timestamp: 1/12/2013 8:38:20 PM
Error: ReferenceError: metrics is not defined
Source File: resource://shumway/web/viewer.html
Line: 56

Shumway doesn't work in the latest Nightly

Shumway version: 0.5.60
Nightly version: 22.0a1 (2013-02-21) (win32)

Even though Shumway is enabled in about:addons -> Extensions, swf objects are opened in Flash. It works in Firefox 19.0.

request for h.264 support

I installed the firefox extension from current (5 July 2012) git master, then viewed http://vimeo.com. I was greeted by an "oops" message. Screencapture is attached.

What needs to be done to support H.264 with Shumway?

constructChildren is called twice on initialization

For a simple SWF that adds some children to the stage, constructChildren() is called twice. Once by the Sprite constructor, and once by the initial nextFrame(), which actually sets the frame number to 1.

This means that some frame scripts could be referencing the wrong child.

avm2 compiler fails to execute flash compiled switch statement

here is the test:

var f = function() {
  switch (0) {
  case 0:
      trace('PASS');
      break;
  }
};

f();
trace('OK');

avm2 compiles the f function as:

[function fn4 ($SS) {
Runtime.stack.push($C[0]);
var $S = $SS, $O = $S.object, $G = $S.global.object, $S = $SS;
var a, b;
a = 0;
if (0 !== a) {
s0 = 1;
} else {
s0 = 0;
}
a = undefined;
switch (s0) {
case 0: {
$S.findProperty($C[19], $C[3], true).public$trace.call($S.findProperty($C[19], $C[3], true), 'PASS');
break;
}
case 1:
default: {
break;
}
}
if ($label === 4) { // <!-- fails here
}
Runtime.stack.pop();
return;
}][0]

asc.jar must be version 1.0 build 23188 (from Common/Configuration/ActionScript 3.0; one from ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar does not compile function as a switch)

Extremely slow performance when mouse is inside

I have the latest Shumway extension. When I go to http://mozilla.github.com/shumway/examples/racing/race3.swf directly and have my mouse outside of the <canvas> element (anywhere in the window, even on the "Shumway X" text - just not on the <canvas>) it runs at normal speed.

However, if the mouse enters the <canvas> element, the performance goes down by AT LEAST a factor of 2. It feels really, really sluggish.

I am on Windows 7 (64bit), FF 19 (32bit), latest Shumway.

Vector3D

package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Vector3D;
import flash.utils.getTimer;

public class Main extends Sprite 
{
    private static var  vect3D:Vector3D = new Vector3D( 0, 0, 0); 
    public function Main():void 
    {  
    }
}

}

// Special case Object, which has no base class but needs the Class class on the scope.

if (!baseClass) {
scope = new Scope(scope, domain.system.Class);
}
scope = new Scope(scope, null);
/*******
**
*
makeNativeClass is undefined at this pos with the precedent class
*
*
*
/

cls = makeNativeClass(this, scope, this.createFunction(ii.init, scope), baseClass);
cls.classInfo = classInfo;
cls.scope = scope;
scope.object = cls;
if ((instance = cls.instance)) {
// Instance traits live on instance.prototype.
this.applyTraits(instance.prototype, scope, baseBindings, ii.traits,
cls.native ? cls.native.instance : undefined, true);
}

Hit areas are placed wrong for buttons

See examples/audio/mp3_player.swf, move your mouse over the "next" button, the state of the "previous" button changes. Hit areas are are shifted to the right.

Fix mouseMove events

mouseMove events are fired continually if mouse is inside an InteractiveObject, even if the position doesn't really change.

Mouse events are completely broken for _mouseChildren=false; DisplayObjects

I'm not sure how to describe this, other than in terms of the event flow. Imagine a Sprite with two children, and _mouseChildren = false;, and the mouse over the first child. The flow:

  1. PreVisitor visits the sprite, does a hit test, finds nothing. Visits the children.
  2. Since _mouseChildren = false;, interactiveParent is the sprite.
  3. Child 1 gets hit tested, it passes, so we queue up a mouseover event on the interactiveParent, and set the click target to it.
  4. Child 2 gets hit tested, it fails. We queue up a mouseout event on theinteractiveParent, and set the click target to null, as it was previously the hit target.

This breaks SimpleButtons, and causes them not to have the hover state. I was working on useHandCursor, and ran into this.

Implement support for button mode

If Sprite::buttonMode is true, sprites and instances of subclasses should act like a button (e.g. receives release events). If the instance is of type MovieClip and includes frames labeled _up, _over, and _down, automatic state changes should be provided.

Reuse/Reduce Event Objects

See examples/timeline/TimelineEvents.swf and examples/timeline/TimelineEventsStress.swf. Currently a new enter/exitFrame event object is created and fired for each movie clip. This can lead to thousands of events per second and we should try to reuse the event objects. In TimelineEvents.swf, the flash player reuses the enterFrame event object.

control of imports and classes

Add a control of imports and classes used to throw an error if abcense of a class.
example:
Native class flash.geom.Vector3D not exist in the stack class inheritance of test class

Flash detection not working

I have just tested Shumway on a site and saw no flash content.
This was caused by the site using a Flash detection script that checked

navigator.plugins["Shockwave Flash"].description 

to ensure a compatible version of Flash could be found.

I'm not sure what can be done about this as the plugins collection is read-only. The only thing that leaps to mind is having a dummy plug-in that has a name of Shockwave Flash, but that seems messy

Implementing FSCommand

I would like to implement FSCommand, which should be a few lines patch.
I need to intercept getURL, which is how FSCommand is implemented in AS2 bytecode, and also be able to retrieve the id of the swf element (or container).

FSCommand callbacks are called in this form:
getURL("FSCommand:[command]","[args]")
which should in turn execute the function:
[swf element id]_DoFSCommand([command],[args])

Add update mechanism to the extension

To allow others to participate on the project you might want to add the update mechanism to the extension. That means you would have to place an update.rdf file onto the gh-pages which references the latest version of the extension. Further in the install.rdf a reference to this update.rdf file has to be placed.

With that users wouldn't have to install a new version of the add-on after manually checking, but would get it automatically.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.