Add initial Emscripten support for Player

There are issues with function pointers yet. This initial approach allows to build and reach these issues.
the function looks confusing, especially the ifdefed while loop