How do I use Video plugin on mobile devices

Get help using Construct 2

Post » Fri Feb 26, 2016 4:10 am

I think mobile devices only play H.264 videos. However, HTML5 prefers .WEBM and .OGV so maybe excluding those formats and use only .MP4 file might work. Desktop browser can play H.264 videos too so don't worry. You can give it a try.
B
11
S
2
Posts: 3
Reputation: 526

Post » Sun Feb 28, 2016 8:27 pm

I also can't get video to play automatically on mobile. It seems to load right up and play fine in NW.js, but not when I preview over LAN or export to mobile. On mobile, the audio plays, but only if I touch the screen first. But I want the video to play right away without any problem. I've imported the video as mp4, webm, and ogv but still nothing seems to work. If there's a direction anyone could point me in, that'd be great. It seems this is a problem all around.
B
25
S
12
G
11
Posts: 260
Reputation: 7,923

Post » Mon Feb 29, 2016 12:00 am

video has been a difficult thing since the start, couldn't get them to play on chrome and safari, sometimes played in firefox, other times not at all. not even audio.
removing the .ogv AND renaming every video so they have NO capitals! worked for me to get the video's to play in the browser directly from website on Firefox, Chrome & Safari. latest versions, desktop. so that's something..
however, mobile is a B&^$% and I've been coming back and forth to this video problem for months!
the Project is getting in shape, all smooth 60fps on mobile :D but basic video won't play (and it HAS to be playable in offline mode!)
if i find anything... i'll post right here. seems to be pretty up to date in here :)
~LL

"90 Degrees" powered by C2 on Google Play: https://play.google.com/store/apps/deta ... etyDegrees
B
59
S
13
G
1
Posts: 24
Reputation: 4,776

Post » Mon Feb 29, 2016 12:27 am

Anonynoise wrote:video has been a difficult thing since the start, couldn't get them to play on chrome and safari, sometimes played in firefox, other times not at all. not even audio.
removing the .ogv AND renaming every video so they have NO capitals! worked for me to get the video's to play in the browser directly from website on Firefox, Chrome & Safari. latest versions, desktop. so that's something..
however, mobile is a B&^$% and I've been coming back and forth to this video problem for months!
the Project is getting in shape, all smooth 60fps on mobile :D but basic video won't play (and it HAS to be playable in offline mode!)
if i find anything... i'll post right here. seems to be pretty up to date in here :)


Thanks for the info. That's pretty unfortunate. The reason I'm using video is because it would take a lot of sprites to create every single animation I have. Video is the only logical choice to make it less of a memory hog. When I play it on mobile via LAN or export out to it, it'll play the audio after touching the screen. I would think that if it's set to autoplay or having the system start it, it should just play.

I really don't get it. Maybe a dev can answer this? I know I'm new and all, but I was really hoping to take full advantage of the feature-set and getting the video plugin to handle the task.
B
25
S
12
G
11
Posts: 260
Reputation: 7,923

Post » Tue Mar 01, 2016 4:04 pm

Bleenx wrote: Thanks for the info. That's pretty unfortunate. The reason I'm using video is because it would take a lot of sprites to create every single animation I have. Video is the only logical choice to make it less of a memory hog. When I play it on mobile via LAN or export out to it, it'll play the audio after touching the screen. I would think that if it's set to autoplay or having the system start it, it should just play.

I really don't get it. Maybe a dev can answer this? I know I'm new and all, but I was really hoping to take full advantage of the feature-set and getting the video plugin to handle the task.


i just noticed in the r222 release they fixed the video bug with capitals! i'll test this later today.
not really the "fix" we're looking for, but at least the video names will look cleaner with capitals back in them :)
and as far as i know, you always need that first touch on mobile, i also managed to get audio but no video with a first touch (the video is in a seperate layout with autostart and events making sure it autostarts, and they work fine on the desktop or web versions.)
i also used buttons to move the video to another layer, set it's size to max screen size, or original size, visibility, global, loading from another layout, went all over google.. :P oh, and different mp4 / webm converts, wth or without streaming option, different bitrate (1000-2500 tested) (VP9 converts crash on my end, so i can't try that yet) and i bet i missed a few more things, but basicly, no video at all. sometimes audio.
i need the video's myself for pre-rendered animations, basicly any fullscreen animation that's too detailed or too heavy for C2 to handle.
png sequences work fantastic but eat a lot of data. and they're all story-based, so i can't rely on the player to always have a stable connection.
i'm not completely sure what the filesize limit are, what's IntelXDk's limit? Google / ios seem to have 2gb now? with the ability to download additional data.
png sequences would still easily fit it these numbers are true.

help? @Ashley ?
~LL

"90 Degrees" powered by C2 on Google Play: https://play.google.com/store/apps/deta ... etyDegrees
B
59
S
13
G
1
Posts: 24
Reputation: 4,776

Post » Tue Mar 01, 2016 7:02 pm

Anonynoise wrote:
Bleenx wrote: Thanks for the info. That's pretty unfortunate. The reason I'm using video is because it would take a lot of sprites to create every single animation I have. Video is the only logical choice to make it less of a memory hog. When I play it on mobile via LAN or export out to it, it'll play the audio after touching the screen. I would think that if it's set to autoplay or having the system start it, it should just play.

I really don't get it. Maybe a dev can answer this? I know I'm new and all, but I was really hoping to take full advantage of the feature-set and getting the video plugin to handle the task.


i just noticed in the r222 release they fixed the video bug with capitals! i'll test this later today.
not really the "fix" we're looking for, but at least the video names will look cleaner with capitals back in them :)
and as far as i know, you always need that first touch on mobile, i also managed to get audio but no video with a first touch (the video is in a seperate layout with autostart and events making sure it autostarts, and they work fine on the desktop or web versions.)
i also used buttons to move the video to another layer, set it's size to max screen size, or original size, visibility, global, loading from another layout, went all over google.. :P oh, and different mp4 / webm converts, wth or without streaming option, different bitrate (1000-2500 tested) (VP9 converts crash on my end, so i can't try that yet) and i bet i missed a few more things, but basicly, no video at all. sometimes audio.
i need the video's myself for pre-rendered animations, basicly any fullscreen animation that's too detailed or too heavy for C2 to handle.
png sequences work fantastic but eat a lot of data. and they're all story-based, so i can't rely on the player to always have a stable connection.
i'm not completely sure what the filesize limit are, what's IntelXDk's limit? Google / ios seem to have 2gb now? with the ability to download additional data.
png sequences would still easily fit it these numbers are true.

help? @Ashley ?


Right, I have the same experience. I hate that the video has to be touched in order to play. My game is an audio visualizer that needs to play to introduce the game, and then play different videos based on a random event. If the player has to touch the video first, it ruins the entire experience. When I test on mobile over Wi-FI or export, it doesn't even show the video at all.

There has to be some way to call video to auto play regardless. My video is only 1,8mb, whereas a sprite sheet of the same animation is 120 frames long and is 27mb....and I have multiple animations that need to be played. No way to decrease the frames because it won't sync perfectly with the audio. Maybe I'll just have to redesign the entire thing.

help? @Ashley ? indeed :D
B
25
S
12
G
11
Posts: 260
Reputation: 7,923

Post » Wed Mar 02, 2016 11:16 am

I'm not aware of any bugs in the video plugin right now (other than the one we just fixed in the latest beta), so if you find any please report them as usual following all the guidelines. However video is a bit tricky due to the browser support situation:

- generally Chrome can play any format, but Chromium (NW.js, Crosswalk) cannot play H.264 (because it's a patented format and Google only have a license for Chrome). VP8 should work. You have to encode these videos yourself, so make sure you get the encoder settings right.
- iOS can only play H.264, not VP8, VP9 or Theora. You can add multiple sources to the video plugin and it will fall back as appropriate. So to guarantee playback on all platforms you need VP8 and H.264.
- on mobile (both Chrome for Android and iOS Safari) you can only start media playback in a touch event. This applies to music as well. Construct 2 uses the same workaround for video as it does for music: if you try to play when you're not allowed to, it queues it up to be played in the next touch event when it will be allowed. However this means you must touch the screen at least once for there to be any chance that video can play. If you're just starting up the app and watching it, it won't be able to play until you touch it.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Wed Mar 02, 2016 3:06 pm

Ashley wrote:I'm not aware of any bugs in the video plugin right now (other than the one we just fixed in the latest beta), so if you find any please report them as usual following all the guidelines. However video is a bit tricky due to the browser support situation:

- generally Chrome can play any format, but Chromium (NW.js, Crosswalk) cannot play H.264 (because it's a patented format and Google only have a license for Chrome). VP8 should work. You have to encode these videos yourself, so make sure you get the encoder settings right.
- iOS can only play H.264, not VP8, VP9 or Theora. You can add multiple sources to the video plugin and it will fall back as appropriate. So to guarantee playback on all platforms you need VP8 and H.264.
- on mobile (both Chrome for Android and iOS Safari) you can only start media playback in a touch event. This applies to music as well. Construct 2 uses the same workaround for video as it does for music: if you try to play when you're not allowed to, it queues it up to be played in the next touch event when it will be allowed. However this means you must touch the screen at least once for there to be any chance that video can play. If you're just starting up the app and watching it, it won't be able to play until you touch it.


Thanks, @Ashley for the info. I have three encoded files that I bring in: mp4, webm, ogv. Even in the case of the encoded VP8 webm file, the audio from the video plays, not the video itself. There's a little black box of the video that pops up, but the actual visuals in it don't play when I test over LAN. You can only hear the audio and see a black box.

I don't know how to attach a .capx file but I can leave this link to DL from my Drive account for someone to test and see if they get the same result as me. https://drive.google.com/file/d/0B9UIax ... sp=sharing I just saved the file as a capx.. not sure if it keeps the video in it when I share it..
B
25
S
12
G
11
Posts: 260
Reputation: 7,923

Post » Sat Mar 05, 2016 1:59 am

Bleenx wrote:
Ashley wrote:I'm not aware of any bugs in the video plugin right now (other than the one we just fixed in the latest beta), so if you find any please report them as usual following all the guidelines. However video is a bit tricky due to the browser support situation:

- generally Chrome can play any format, but Chromium (NW.js, Crosswalk) cannot play H.264 (because it's a patented format and Google only have a license for Chrome). VP8 should work. You have to encode these videos yourself, so make sure you get the encoder settings right.
- iOS can only play H.264, not VP8, VP9 or Theora. You can add multiple sources to the video plugin and it will fall back as appropriate. So to guarantee playback on all platforms you need VP8 and H.264.
- on mobile (both Chrome for Android and iOS Safari) you can only start media playback in a touch event. This applies to music as well. Construct 2 uses the same workaround for video as it does for music: if you try to play when you're not allowed to, it queues it up to be played in the next touch event when it will be allowed. However this means you must touch the screen at least once for there to be any chance that video can play. If you're just starting up the app and watching it, it won't be able to play until you touch it.


Thanks, @Ashley for the info. I have three encoded files that I bring in: mp4, webm, ogv. Even in the case of the encoded VP8 webm file, the audio from the video plays, not the video itself. There's a little black box of the video that pops up, but the actual visuals in it don't play when I test over LAN. You can only hear the audio and see a black box.

I don't know how to attach a .capx file but I can leave this link to DL from my Drive account for someone to test and see if they get the same result as me. https://drive.google.com/file/d/0B9UIax ... sp=sharing I just saved the file as a capx.. not sure if it keeps the video in it when I share it..



I GOT THEM PLAYING, YES!
i simply deleted the .mp4 and Theora sources from the project (and make sure when you export to the same folder, old files -with older names- are still there)
next, i loaded up a Webm vp8, resolution set to 1280x720 (in my 640x360 game!) variable bitrate of 1200 and Vorbis audio.
the video plays perfectly fine after touching "new game" from the layout before that. so it basicly plays just fine without the need for another touch in this particular layout, so i bet you could find a way sorting your problem out as well :)

thanks again @Ashley !, you guys already provide so much with C2 in general plus all the effort on your community.
really amazing job you guys doing! <3
~LL

"90 Degrees" powered by C2 on Google Play: https://play.google.com/store/apps/deta ... etyDegrees
B
59
S
13
G
1
Posts: 24
Reputation: 4,776

Post » Sat Mar 05, 2016 4:04 am

Anonynoise wrote:
Bleenx wrote:
Ashley wrote:I'm not aware of any bugs in the video plugin right now (other than the one we just fixed in the latest beta), so if you find any please report them as usual following all the guidelines. However video is a bit tricky due to the browser support situation:

- generally Chrome can play any format, but Chromium (NW.js, Crosswalk) cannot play H.264 (because it's a patented format and Google only have a license for Chrome). VP8 should work. You have to encode these videos yourself, so make sure you get the encoder settings right.
- iOS can only play H.264, not VP8, VP9 or Theora. You can add multiple sources to the video plugin and it will fall back as appropriate. So to guarantee playback on all platforms you need VP8 and H.264.
- on mobile (both Chrome for Android and iOS Safari) you can only start media playback in a touch event. This applies to music as well. Construct 2 uses the same workaround for video as it does for music: if you try to play when you're not allowed to, it queues it up to be played in the next touch event when it will be allowed. However this means you must touch the screen at least once for there to be any chance that video can play. If you're just starting up the app and watching it, it won't be able to play until you touch it.


Thanks, @Ashley for the info. I have three encoded files that I bring in: mp4, webm, ogv. Even in the case of the encoded VP8 webm file, the audio from the video plays, not the video itself. There's a little black box of the video that pops up, but the actual visuals in it don't play when I test over LAN. You can only hear the audio and see a black box.

I don't know how to attach a .capx file but I can leave this link to DL from my Drive account for someone to test and see if they get the same result as me. https://drive.google.com/file/d/0B9UIax ... sp=sharing I just saved the file as a capx.. not sure if it keeps the video in it when I share it..



I GOT THEM PLAYING, YES!
i simply deleted the .mp4 and Theora sources from the project (and make sure when you export to the same folder, old files -with older names- are still there)
next, i loaded up a Webm vp8, resolution set to 1280x720 (in my 640x360 game!) variable bitrate of 1200 and Vorbis audio.
the video plays perfectly fine after touching "new game" from the layout before that. so it basicly plays just fine without the need for another touch in this particular layout, so i bet you could find a way sorting your problem out as well :)

thanks again @Ashley !, you guys already provide so much with C2 in general plus all the effort on your community.
really amazing job you guys doing! <3


I'm glad you got it to work! Unfortunately, I've done the same thing and can't get the video to show over LAN or on export. I've basically given up on it. I just see no way of making it work.
B
25
S
12
G
11
Posts: 260
Reputation: 7,923

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 45 guests