I just completed an app and got it built for Android yet problem arises in the video streaming session. This is what I received “Video cannot play on device” when video is stored/streamed from AWS Amazon.
The Device used is Sony Ericsson with ARM7, other stuffs played well when included in the built; I’ve got sounds and 1 video file.
Here’s the code for the video stream… The same code used for iOS and works wonder… The entire code was compiled using the latest build of Corona #777. The same problem occurred when using #704a. So I guess it’s not the compiler issues…
[code]-- Code created by Gfunkerwin - Copyright: aktifmob.com
– Version: 1.9.1a
– All Rights Reserved 2009-2012
module(…, package.seeall)
local ads = require “ads”
local isSimulator = system.getInfo(“environment”) == “simulator”
function testNetworkConnection()
local netConn = require(‘socket’).connect(‘www.aktifmob.com’, 80)
if netConn == nil then
return false
end
netConn:close()
return true
end
–Initialize ads
ads.init( “inneractive”, “Aktifmob_TheRaidRedemption_iPhone” )
function new()
local numPages = 12
local menuGroup = display.newGroup()
local disposeAudios
local disposeTweens
local kwkbutbackoff_audio = audio.loadSound(audioDir…“gunmagmix.mp3” )
local curPage = 7
local drawScreen = function()
local kwkbarlogo
local kwkbutbackon
local kwkbutbackoff
local kwktopwall
local kwkwalls
local butInterOn
local butInter
local butUSon
local butUS
local pictrailer
local kwkbgTrailer
–INNERACTIVE ADS1–
local isSimulator = system.getInfo(“environment”) == “simulator”
– display banner ads
if( isSimulator or not testNetworkConnection() ) then
print (“simulator”)
local banner2 = display.newRect( 0, 855, 640, 106 )
banner2:setFillColor(255, 255, 255)
else
if ( sysModel == “iPad” ) then
elseif ( sysModel == “Kindle Fire” ) then
APP_ID = “Aktifmob_TheRaidRedemption_iPhone”
else
APP_ID = “Aktifmob_TheRaidRedemption_iPhone”
end
ads.show( “banner”, { x=0, y=855, interval=35} )
end
–END INNERACTIVE ADS1–
–WEB POPUP–
local butWebBack = display.newImageRect( imgDir… “btnClose1.png”, 122,44)
butWebBack.x = 560; butWebBack.y = 44
butWebBack.isVisible = false
local popBg = display.newImageRect(imgDir… “kwktopwall.png”, 640, 121);
popBg.x = 320; popBg.y = 59
popBg.isVisible = false
local popBack = display.newRect(0, 83, 640, 960) --display.newImageRect( imgDir… “kwkbgdark.jpg”, 640, 960 )
popBack.x = 320; popBack.y = 480
–popBack.strokeWidth = 3
popBack:setFillColor(255,255,255,100)
–popBack:setStrokeColor(180, 180, 180)
popBack.isVisible = false
function butWebBack:tap(e)
popBack.isVisible = false
butWebBack.isVisible = false
popBg.isVisible = false
–butWebLogo.isVisible = false
native.cancelWebPopup()
end
butWebBack:addEventListener(“tap”, butWebBack)
–END WEB POPUP–
–(2) regular layer
kwkbgTrailer = display.newImageRect( imgDir… “kwkbgtrailer.png”, 640, 960 );
kwkbgTrailer.x = 320; kwkbgTrailer.y = 480; kwkbgTrailer.alpha = 1; kwkbgTrailer.oldAlpha = 1
menuGroup:insert(kwkbgTrailer)
menuGroup.kwkbgTrailer = kwkbgTrailer
–(2) regular layer
pictrailer = display.newImageRect( imgDir… “p7_pictrailer.png”, 366, 440 );
pictrailer.x = 342; pictrailer.y = 738; pictrailer.alpha = 0.2; pictrailer.oldAlpha = 0.2
menuGroup:insert(pictrailer)
menuGroup.pictrailer = pictrailer
local onbutUSTouch = function(event)
if event.phase==“ended” then
disposeAudios(event)
audio.stop(1); audio.dispose(mikeshinoda_theraid_audio); mikeshinoda_theraid_audio =nil
media.playVideo( “https://s3-ap-southeast-1.amazonaws.com/the-raid/theraid_us_trailer.m4v”, media.RemoteSource, true ) --THIS IS THE CODE THAT GIVING ME HEADACHE PLAYS ON IOS NOT ON ANDROID–
end
end
–(10) regular layer
butUS = ui.newButton{
defaultSrc=imgDir…“p7_butus.png”,
defaultX = 254,
defaultY = 145,
overSrc=imgDir…“p7_butuson.png”,
overX = 254,
overY = 145,
onRelease=onbutUSTouch,
id=“butUSButton”
}
butUS.x = 468; butUS.y = 390; butUS.alpha = 1; butUS.oldAlpha = 1
menuGroup:insert(butUS)
menuGroup.butUS = butUS
local onbutInterTouch = function(event)
if event.phase==“ended” then
disposeAudios(event)
audio.stop(1); audio.dispose(mikeshinoda_theraid_audio); mikeshinoda_theraid_audio =nil
media.playVideo( “https://s3-ap-southeast-1.amazonaws.com/the-raid/theraid_sxsw_trailer.m4v”, media.RemoteSource, true ) --THIS IS THE CODE THAT GIVING ME HEADACHE PLAYS ON IOS NOT ON ANDROID–
end
end
–(10) regular layer
butInter = ui.newButton{
defaultSrc=imgDir…“p7_butinter.png”,
defaultX = 254,
defaultY = 145,
overSrc=imgDir…“p7_butinteron.png”,
overX = 254,
overY = 145,
onRelease=onbutInterTouch,
id=“butInterButton”
}
butInter.x = 173; butInter.y = 390; butInter.alpha = 1; butInter.oldAlpha = 1
menuGroup:insert(butInter)
menuGroup.butInter = butInter
local onbutImdbTouch = function(event)
if event.phase==“ended” then
native.showWebPopup( 0, 83, 640, 970, “http://m.imdb.com/title/tt1899353/”, “moveFromBottom” )
– Back button visibility
butWebBack.isVisible = true
popBg.isVisible = true
popBack.isVisible = true
–butWebLogo.isVisible = true
disposeAudios(event)
audio.stop(1); audio.dispose(mikeshinoda_theraid_audio); mikeshinoda_theraid_audio =nil
end
end
–(10) regular layer
butImdb = ui.newButton{
defaultSrc=imgDir…“but_imdboff.png”,
defaultX = 300,
defaultY = 150,
overSrc=imgDir…“but_imdbon.png”,
overX = 300,
overY = 150,
onRelease=onbutImdbTouch,
id=“butImdbButton”
}
butImdb.x = 320; butImdb.y = 800; butImdb.alpha = 1; butImdb.oldAlpha = 1
menuGroup:insert(butImdb)
menuGroup.butImdb = butImdb
–(2) regular layer
kwkwalls = display.newImageRect( imgDir… “kwkwalls.png”, 747, 928 );
kwkwalls.x = 266; kwkwalls.y = 497; kwkwalls.alpha = 1; kwkwalls.oldAlpha = 1
menuGroup:insert(kwkwalls)
menuGroup.kwkwalls = kwkwalls
–(2) regular layer
–kwktopwall = display.newImageRect( imgDir… “topwall.png”, 640, 121 );
kwktopwall = display.newImageRect( imgDir… “kwktopwall.png”, 640, 109 );
kwktopwall.x = 321; kwktopwall.y = 59; kwktopwall.alpha = 1; kwktopwall.oldAlpha = 1
menuGroup:insert(kwktopwall)
menuGroup.kwktopwall = kwktopwall
local onkwkbutbackoffTouch = function(event)
if event.phase==“ended” then
local myClosure_switch = function()
disposeTweens()
director:changeScene( “page_3”, “moveFromTop” )
end
timerStash.newTimer_369 = timer.performWithDelay(0, myClosure_switch, 1)
local myChannel = 2
local isChannelPlaying = audio.isChannelPlaying(myChannel)
if isChannelPlaying then
–nothing
else
audio.play( kwkbutbackoff_audio, {channel=myChannel} )
end
end
end
–(10) regular layer
kwkbutbackoff = ui.newButton{
defaultSrc=imgDir…“btnClose1.png”,
defaultX = 122,
defaultY = 44,
overSrc=imgDir…“btnClose2.png”,
overX = 122,
overY = 44,
onRelease=onkwkbutbackoffTouch,
id=“kwkbutbackoffButton”
}
kwkbutbackoff.x = 560; kwkbutbackoff.y = 44; kwkbutbackoff.alpha = 1; kwkbutbackoff.oldAlpha = 1
menuGroup:insert(kwkbutbackoff)
menuGroup.kwkbutbackoff = kwkbutbackoff
–2
gtStash.gt_pictrailer= gtween.new( pictrailer, 1.8, { x = 357, y = 738, rotation = 0, xScale = 1, yScale = 1, alpha=1}, {ease = gtween.easing.linear, repeatCount = math.huge, reflect = true, delay=0.8})
end
drawScreen()
function disposeAudios(event)
audio.stop(2); audio.dispose(kwkbutbackoff_audio); kwkbutbackoff_audio = nil
audio.stop(1); audio.dispose(mikeshinoda_theraid_audio); mikeshinoda_theraid_audio =nil
end
function disposeTweens(event)
cancelAllTweens();
cancelAllTimers();
cancelAllTransitions();
end
–Clean up local variables, etc…
clean = function()
print(“Cleaning”)
end
return menuGroup
end
[/code]
Any ideas? Been trying with media.playVideo then media.streamVideo with no luck. Is it the file format? I’ve tried with .mp4 and .3gpp with the same results; not playing as stream but ok as local files…
Any help would be appreciated thank you
Gfunkerwin [import]uid: 68581 topic_id: 24560 reply_id: 324560[/import]