flowplayer / flash

Flowplayer Flash, the video player for the Web
http://flowplayer.org
282 stars 182 forks source link

Build readme #248

Open marwahaha opened 10 years ago

marwahaha commented 10 years ago

I think it would be really helpful to update the building instructions. The ramp-up seems to be the hardest part..

This is what I came up with for myself, maybe the repo or website could use it?

1. Clone the flash, flash-build, and tld repositories:

git clone https://github.com/flowplayer/flash.git
git clone https://github.com/flowplayer/flash-build.git 
git clone https://github.com/flowplayer/tld.git 

2. Edit the flash-build/build.properties file:

#need to install flex sdk
flexdir = {{path to flexsdk}}

#swf files will be saved here (the site directory will be at the same level as flash, flash-build, tld directories)
site.dir = ../site

#these files will be built along with the core flashplayer. At minimum, controls plugin needs to be built.
plugin.buildfiles = controls/build.xml

3. Edit the flash-build/plugin-build.properties file:

flexdir = {{path to flexsdk}}

4. If on Windows, make these edits:

#add .exe to the compilers in the flash-build/build.properties file:
mxmlc_bin = ${flexbindir}/mxmlc.exe
compc_bin = ${flexbindir}/compc.exe
asdoc_bin = ${flexbindir}/asdoc.exe

#change the path to java in flash-build/js.xml
<apply executable="C:\Program Files\{{path to java.exe}}" parallel="false">

5. If on Mac, your default java may not have a 32-bit option. (Mac JDK 1.7 and 1.8 only support 64-bit JVMs.) The Flex compilers necessary to build the project depend on a 32-bit JVM (Java Virtual Machine).

You can check defaults by running

java -d32

If you see this error, then you'll have to point to a JDK that supports a 32-bit JVM, like 1.6. Otherwise, you can move on.

Error: This Java instance does not support a 32-bit JVM.

You may have other JDKs installed: Check by running

/usr/libexec/java_home -v 1.6

For me, this printed out:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

You can change the default java for the current session by running

export PATH={{whatever it printed out}}/../Commands:$PATH

This prepends the PATH variable will all commands from JDK 1.6 (including java). "java" will now point to 1.6 for this terminal session.

6. Change directory to flash-build, and run "ant":

cd flash-build
ant

If you see BUILD SUCCESSFUL, you have successfully compiled. Your swf files are in the directories "site" and "flash-build/build".

moondigi commented 9 years ago

how can i build all plugins into one swf file? any BuiltInConfig.as sample? thx

danrossi commented 9 years ago

they are commented out in the file. that will give you the information you need. You have to add the sources and the swc library files to the build

this adds the paths to sources plugin-classes=

this adds the paths to swc files plugin-swc=

danrossi commented 9 years ago

ie

package  {

import org.flowplayer.controls.Controls;

public class BuiltInConfig {

    private var controls:org.flowplayer.controls.Controls;

    public static const config:Object = { 
       "plugins": {
        "controls": {
            "url": 'org.flowplayer.controls.Controls'
        }

       }
    }; 
}
moondigi commented 9 years ago

thx danrossi, i tried this but loadCaptions(); hide/showButton(); function not work.

plugin-classes=${plugins.dir}/controls/src/actionscript ${lib.dir}/common/src/actionscript ${plugins.dir}/content/src/actionscript ${plugins.dir}/captions/src/actionscript

plugin-swc=${plugins.dir}/controls/src/flash ${plugins.dir}/captions/src/flash ${plugins.dir}/content/src/flash
package {
    import org.flowplayer.captions.CaptionPlugin;
    import org.flowplayer.content.Content;
    import org.flowplayer.controls.Controls;

    public class BuiltInConfig {
        private var captions:org.flowplayer.captions.CaptionPlugin;
        private var content:org.flowplayer.content.Content;
        private var controls:org.flowplayer.controls.Controls;

        public static const config:Object = {
            "plugins": {
                "captions": {
                    "captionTarget": "content",
                    "url": "org.flowplayer.captions.Caption"
                },
                "content": {
                    "url": "org.flowplayer.content.Content"
                },
                "controls": {
                    "url": "org.flowplayer.controls.Controls"
                }
            }
        }
    };
}
danrossi commented 9 years ago

"url": "org.flowplayer.captions.CaptionPlugin"

moondigi commented 9 years ago

O_o ok i fix it but seems still not work here is my files http://1drv.ms/1xuT15F

package {
    import org.flowplayer.captions.CaptionPlugin;
    import org.flowplayer.content.Content;
    import org.flowplayer.controls.Controls;

    public class BuiltInConfig {
        private var captions:org.flowplayer.captions.CaptionPlugin;
        private var content:org.flowplayer.content.Content;
        private var controls:org.flowplayer.controls.Controls;

        public static const config:Object = {
            "plugins": {
                "captions": {
                    "captionTarget": "content",
                    "url": "org.flowplayer.captions.CaptionPlugin"
                },
                "content": {
                    "url": "org.flowplayer.content.Content"
                },
                "controls": {
                    "url": "org.flowplayer.controls.Controls"
                }
            }
        }
    };
}

unnamed

danrossi commented 9 years ago

$f("id").getPlugin("captions").hideButton(); try that no idea. is it actually loading. you should see a browser log !.

moondigi commented 9 years ago

i've tested

package {
    import org.flowplayer.content.Content;
    import org.flowplayer.controls.Controls;

    public class BuiltInConfig {
        private var content:org.flowplayer.content.Content;
        private var controls:org.flowplayer.controls.Controls;

        public static const config:Object = {
            "plugins": {
               "captions": {
                    "captionTarget": "content",
                    "url": "flowplayer.captions.swf"
                },
                "content": {
                    "url": "org.flowplayer.content.Content"
                },
                "controls": {
                    "url": "org.flowplayer.controls.Controls"
                }
            }
        }
    };
}

loadCaptions(); hide/showButton(); function not work but subs can display. flowplayer.captions.swf download from http://flash.flowplayer.org/plugins/flash/captions.html

<!doctype html>
<meta charset="utf-8">
<script src="flowplayer-3.2.13.min.js"></script>
<div id="player" style="width:640px; height:360px; display:block"></div>
<script>
$f('player','flowplayer-3.2.18.swf',{
    clip:{
        url:'sample.mp4',
        captionUrl:'buffalo.srt'
    }
})
</script>

this way everything works fine, use the same flowplayer-3.2.18.swf, function only broken when built-in?

<!doctype html>
<meta charset="utf-8">
<script src="flowplayer-3.2.13.min.js"></script>
<div id="player" style="width:640px; height:360px; display:block"></div>
<script>
$f('player','flowplayer-3.2.18.swf',{
    clip:{
        url:'sample.mp4',
        captionUrl:'buffalo.srt'
    },
    plugins: {

                captions: {
                    captionTarget: "content",
                    url: "flowplayer.captions.swf"
                }
    }
})
</script>
majoscho commented 9 years ago

Thanks to marwahaha! Your update of the installation instructions was yery helpful to me. :)