Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

publishing air apk with videos

Explorer ,
Jul 01, 2021 Jul 01, 2021

Hi, i created an Air App, using more than 1 video in diferent layers,

 

the app has buttons to show and play the videos.

when tested in Air for mobile all videos are shown and played.

 

When publishing I add the video files links on the AIR for andoid settings. at Included files.

When installed on the android device only 1 video is visible.

 

Attached settings image. 

appreciate any help!

 

thanks!

 

Screen Shot 2021-07-01 at 9.02.19 PM.png

1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct answers

Community Expert , Jul 04, 2021 Jul 04, 2021

put one flvpb instance on stage with no source assigned in the comp param panel, assign it an instance name (eg, flvpb), and add two mcs (mc1 and mc2).  add code

 

for(var i=1;i<=2;i++){
this["mc"+i].addEventListener(MouseEvent.MOUSE_DOWN, f);

}

function f(e:MouseEvent):void{
if(e.currentTarget.name.indexOf("1")>0){
flvpb.source="vid1";  // use valid name

} else {
flvpb.source ="vid2";  // valid name

}

}

 

Translate
Community Expert , Jul 05, 2021 Jul 05, 2021

1. you should have only one flvplayback component on stage.  put nothing in its parameter panel.  it'll play the correct video using code.  that's the point.  

 

2. which ever instance you allow on stage, it needs that instance name, flvpb

 

2.  put mc1 and mc2 anywhere.  they exist just for demo purposes.  it isn't necessary to use movieclips/buttons to play different videos.  it's just a quick easy way to demo how using code will play different videos using one flvplayback instance.

Translate
Community Expert , Jul 05, 2021 Jul 05, 2021

mc1 and mc2 are instance names of two movieclips on stage 

Translate
Explorer ,
Jul 02, 2021 Jul 02, 2021

the only visible video is : video/cerro_pajita_video.mp4

 

o

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2021 Jul 03, 2021

ive tried changing directory, reloading videos but i cant make it play more than 1 video.

 

any help ewould be appreciated.  thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2021 Jul 03, 2021
hi here example of the code:

//1-EL MACHO

EL_MACHO_VIDEO.visible = false;

background_slider.button_1.addEventListener (MouseEvent.CLICK,
FunctionName);

function FunctionName(event:MouseEvent):void

{
EL_MACHO_VIDEO.visible = true
EL_MACHO_VIDEO.movieClip_8.play();
}

background_slider.seeatt_chorro.CHORRO_LINK_1.addEventListener
(MouseEvent.CLICK, openatt_1);

function openatt_1(event:MouseEvent):void

{
EL_MACHO_VIDEO.visible = true
EL_MACHO_VIDEO.movieClip_8.play();
}

EL_MACHO_VIDEO.back_chorro.addEventListener (MouseEvent.CLICK,
FunctionName3);

function FunctionName3(event:MouseEvent):void

{
EL_MACHO_VIDEO.movieClip_8.stop();
EL_MACHO_VIDEO.movieClip_8.seek(0)
EL_MACHO_VIDEO.info_anim.gotoAndStop(1);
EL_MACHO_VIDEO.visible = false
menu_inicial.gotoAndStop(1);
}

EL_MACHO_VIDEO.stop_macho.addEventListener(MouseEvent.CLICK,
fl_ClickToPauseVideo);

function fl_ClickToPauseVideo(event:MouseEvent):void
{
EL_MACHO_VIDEO.movieClip_8.pause();
}

EL_MACHO_VIDEO.play_macho.addEventListener(MouseEvent.CLICK,
fl_ClickToPlayVideo_4);

function fl_ClickToPlayVideo_4(event:MouseEvent):void
{
EL_MACHO_VIDEO.movieClip_8.play();
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2021 Jul 03, 2021

Here is the code im using:

LA_INDIA.visible = false;

background_slider.button_LA_INDIA.addEventListener (MouseEvent.CLICK, play_LA_INDIA);

function play_LA_INDIA(event:MouseEvent):void

{
  LA_INDIA.visible = true
  LA_INDIA.la_india_dormida_video.play();
}

background_slider.seeatt_LA_INDIA.CHORRO_LINK_1.addEventListener (MouseEvent.CLICK, play_LA_INDIA_2);

function play_LA_INDIA_2(event:MouseEvent):void

{
  LA_INDIA.visible = true
  LA_INDIA.la_india_dormida_video.play();
}

LA_INDIA.back_LA_INDIA.addEventListener (MouseEvent.CLICK, back_LA_INDIA);

function back_LA_INDIA(event:MouseEvent):void

{
	LA_INDIA.la_india_dormida_video.stop();
	LA_INDIA.la_india_dormida_video.seek(0)
	LA_INDIA.anim_LA_INDIA.gotoAndStop(1);
	LA_INDIA.visible = false
	menu_inicial.gotoAndStop(1);	
}

LA_INDIA.stop_LA_INDIA.addEventListener(MouseEvent.CLICK, stop_LA_INDIA);

function stop_LA_INDIA(event:MouseEvent):void
{
	LA_INDIA.la_india_dormida_video.pause();
}

LA_INDIA.play_LA_INDIA.addEventListener(MouseEvent.CLICK, play_LA_INDIA_3);

function play_LA_INDIA_3(event:MouseEvent):void
{
	LA_INDIA.la_india_dormida_video.play();
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

are you using more than one video/playback instance on stage (eg, in different layers)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2021 Jul 04, 2021

HI,

YES 8 layers

eacho with a movie.  all are hidden and are unhidden by a button on the firt layer.

Screen Shot 2021-07-04 at 1.16.23 PM.png

this is a problem im having not only on this proyect.

if i do a simple android canvas and import more than one video on one layer.  only 1 is visible when i publish apk.  Even if i include both videos.  I dont know if there is one step im missing.

thanks!

 

o

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

use one component and change the source in your code to play different videos.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2021 Jul 04, 2021

i use the one component, and change the source using the component parameters dialog box.

dont know how to change it directly on the code.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

use 1 flvplayback component and use its source property to assign the various flvs to play.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2021 Jul 04, 2021

yes, that is exactly what i did.  It works fine when I test the app using the AIR debug Luncher (mobile). All 8 videos play.  The problem is when I publish APK and install on android device.  Here only one of the videos load.

I suspect it could be something with the APK export settings. But I look at all settings and everything looks ok.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

you're using multiple instances of the flvplayback component.  use one.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2021 Jul 04, 2021

not sure i understand. This might be beyond my capabilities.

i made this new file, to try tu understand, just two videos on the canvas, I inserted the FLVPlayback component, and changed the source for each one.   (image 1).  when test on Animate two videos play. (image 2)  when exported to APK an tested using BlueStakc emulator, and Android tablet. only the bottom video is visible. (image 3)

Not sure where im i using multiple instances. 

 

image_1.pngimage_2.pngimage_3.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

put one flvpb instance on stage with no source assigned in the comp param panel, assign it an instance name (eg, flvpb), and add two mcs (mc1 and mc2).  add code

 

for(var i=1;i<=2;i++){
this["mc"+i].addEventListener(MouseEvent.MOUSE_DOWN, f);

}

function f(e:MouseEvent):void{
if(e.currentTarget.name.indexOf("1")>0){
flvpb.source="vid1";  // use valid name

} else {
flvpb.source ="vid2";  // valid name

}

}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2021 Jul 04, 2021

i get this error: 

Screen Shot 2021-07-04 at 10.28.29 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 04, 2021 Jul 04, 2021

you're not following my suggestion 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 05, 2021 Jul 05, 2021

here i made the test with only the 2 videos on the canvas.  get this error.  Probably i dont understand where i should add the mc1, mc2

Im writing that on the Instance name box for each flvpb component.

Screen Shot 2021-07-05 at 7.02.05 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2021 Jul 05, 2021

1. you should have only one flvplayback component on stage.  put nothing in its parameter panel.  it'll play the correct video using code.  that's the point.  

 

2. which ever instance you allow on stage, it needs that instance name, flvpb

 

2.  put mc1 and mc2 anywhere.  they exist just for demo purposes.  it isn't necessary to use movieclips/buttons to play different videos.  it's just a quick easy way to demo how using code will play different videos using one flvplayback instance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 05, 2021 Jul 05, 2021

thank kglad,

 

still confused about what mc1 and mc2 are.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 05, 2021 Jul 05, 2021

This is a screenshot of the setup, ant the error i get whn i test.

 

Screen Shot 2021-07-05 at 3.53.31 PM.pngScreen Shot 2021-07-05 at 3.55.01 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2021 Jul 05, 2021

mc1 and mc2 are instance names of two movieclips on stage 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 05, 2021 Jul 05, 2021

OK, now it works!

 

I understand now the concept. Will try to incorporate this knoledge to the app im making. 

many thanks!!!

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 06, 2021 Jul 06, 2021

i have a new problem.  now I need to replicate this on a new scene. to be able to go from one scene tothe other.  To have videos on the new scene i have to add a component.  Now videos dont show on APK because i have two components.  Is there a way to be able to play videos on multiple scenes? 

 

thanks

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 10, 2022 Jan 10, 2022

using scenes is a bad idea.  they don't even exist in anything you publish.

 

anyway, you create a dynamic instance of one flvplayback and use it across the entire timeline whether there's a new keyframe (which is what a new screne creates), or not.

 

import fl.video.*;
var flv:FLVPlayback = new FLVPlayback();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2022 Apr 02, 2022

I am a newbie and I am having the same problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines