Skip to main content
chenjil43641795
Legend
October 22, 2020
Question

(ANCC html5) Copy files to Android phone. The file could not be played. --Help,Help,Help me

  • October 22, 2020
  • 4 replies
  • 581 views

I made an animation to HTML5 and copied it to my phone.The file cannot be played.

I don't know what's going on.

I don't know what the problem is.

 

What I'm doing is clicking switch video files.It can be played in a computer browser.

But copying to an Android phone won't play.

 

Help me, I'm very worried

 

I have uploaded my source file.

 

https://drive.google.com/file/d/1xso58WA7MboW3lCxK9kTGvN8ZHNmvm9Z/view?usp=sharing

 

@Preran  @kglad @JoãoCésar17023019  @ClayUUID    @ankushr40215001 

    This topic has been closed for replies.

    4 replies

    kglad
    Community Expert
    Community Expert
    October 24, 2020

    the "correct location" according to your code is "videos/kc.mp4" and that location is relative to the folder that contains your app.

    chenjil43641795
    Legend
    October 24, 2020

    The video file is in the video folder(videos/kc.mp4).

    Now I know why, visit file:///   This is not supported.Support only (https  http).

    Cross-domain. Error. The local resource could not be read.

    Not just videos,

    pictures and Js Jq,

    If it's not hosted, it can't be read.

    That's why it can't be played.

    But I don't know the code.

     

    View a large amount of material.

     

    Other Android developers use the following methods to load.

    Use WebView.(LoadUrl, LoadData, LoadDataWithBaseURL.)

    webView.loadUrl("file:///android_assets/file_name");

     

    But how to write code in ANimate CC.

     

    kglad
    Community Expert
    Community Expert
    October 23, 2020

    videos won't play automatically on mobiles.  a play button press is required.

     

    in addition, if the video is not embedded in the app timeline, you'll need to load the video (to the correct location) on your mobile.

    chenjil43641795
    Legend
    October 24, 2020

    Buttons were made from the start.  

     

    "correct position"What does that mean?Is there a path problem?

     

    The video doesn't play on Android phone.

     

     

     

    The code for the first frame.

     

     

     

    var ts=this
    canvas.style.zIndex = "1"; 

    //Full-screen code.

    var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
    (document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
    (document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
    (document.msFullscreenElement && document.msFullscreenElement !== null);
    var docElm = document.documentElement;

     

    //py is a button for playing video and full screen.
    this.py.addEventListener("click", bfsp.bind(this));
    function bfsp()
    {ts.py.gotoAndStop('cc');
    var videoURL = "videos/kc.mp4";
    $("#video1")[0].src=videoURL;
    $("#video1")[0].addEventListener("ended",nextFrame);
    $("#video1")[0].play();

    if (docElm.requestFullscreen) {
    docElm.requestFullscreen();
    } else if (docElm.mozRequestFullScreen) {
    docElm.mozRequestFullScreen();
    } else if (docElm.webkitRequestFullScreen) {
    docElm.webkitRequestFullScreen();
    } else if (docElm.msRequestFullscreen) {
    docElm.msRequestFullscreen();
    }

    }


    function nextFrame(evt) {
    evt.currentTarget.removeEventListener("ended",nextFrame);
    ts.gotoAndPlay("Framepy")
    }

     


    var myInstance = createjs.Sound.play("sy", {loop:999});//Background music
    myInstance.on("loop", handleLoop);
    function handleLoop(event) {
    //myInstance.volume = myInstance.volume * 0.5;
    }

    this.stop()

    chenjil43641795
    Legend
    October 22, 2020

    Android 10

     

    Windows 10 Mobile

     

     

    Can't play on Android。

     

     

    kglad
    Community Expert
    Community Expert
    October 22, 2020

    upload your files (all the ones published by your fla) to a file server and navigate to that url using your mobile's browser.

     

    if that's not what you want, what is it that you expect to do with those files on your mobile?

    chenjil43641795
    Legend
    October 22, 2020

    Play offline on your phone.

    Do not connect to the Internet.

    This can be done when it is pure animation。

    But now video can't be played.

     

     It can also be played using windows phone 10

    However, this does not play on Android.

     

    Now I need to send it to someone else who uses Android.

     

    chenjil43641795
    Legend
    October 23, 2020

    I tested dozens of Android browsers.

    Some browsers can display buttons.

    But all browsers can't play videos.