언어 설정

Menu
Sites
Language
Audio out of sync while page transition

I just have an audio element in page1 and while it is playing, I click on an image and go to page2 using the pagemanager.changePage() method inside the onClick event function. While the page transitions, the audio playback is having a momentary pause followed by a slight positive jump, like say 0.4 seconds or so. When I come back to page1 by clicking on the 'back button' in page2, the same happens. I have DOM cache enabled in both the pages. It doesn't have any effect when I disable the DOM cache.
Can someone explain the reason why it is so ?
 

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

15 댓글
Lakshmi Grandhi
I am looking into your issue, will get back soon
Lakshmi Grandhi
I tried adding Audio inside Page 1 using below code On moving to Page2, the auido is paused, i didn't observed any jump and after returning to Page1, play button is properly working. Kindly share your code to reproduce your issue Thanks Lakshmi
Uday Bhaskar D
//page1.js _page1_page.prototype.onpagebeforecreate = function(event) { var song = document.createElement("audio"); song.setAttribute("id", "song_stream"); song.setAttribute("controls","controls"); document.getElementById("div2").appendChild(song); }; _page1_page.prototype.list_btn_ontap = function(event) { console.log("list button tap"); pageManager.changePage("page2",{ transition: "slide", reverse:true }); }; //page2.js _page2_page.prototype.onpagecreate = function(event) { //some code which creates list nodes containing text, and adds them to a list view };
Lakshmi Grandhi
Thanks for sharing code, after launching application on page transition to second page it didn't observe jump, but after returning to page 1, the audio is rest to start(page1 got refreshed) , while in case of webapplication using Tizen UI Framework, the audio was paused and played from the point where it has been stoped.
Uday Bhaskar D
I was using the WEB UI framework. But the audio in my case continues when I navigate to second page and back to page1. "I set the source to the audio element in the 'onpageinit' event of page1." Does the onpageinit get called everytime we navigate back to page1 ? In which case your observed behavior fits in. But in my case the song continues to play, so I guess the source is not being reset when I navigate back to page1 ?
Uday Bhaskar D
I've tested the page events, they are getting called only once upon creating a page, I've enabled the DOM cache in both the pages. You've not enabled that, may be that is the case with you, as I observe the events getting called upon changing the page.(without DOM cache enabled). Can you please check with DOM cache enabled in both the page properties.
Uday Bhaskar D
Sorry for posting again. I thought you'll be notified if I reply to your comment :)
Uday Bhaskar D
I've identified the exact problem. The audio can't be heard for the below exact duration, but the song is continuing in the background. When I change page from page1 to page2, between this exact transition >>> onpagebeforeshow of page2 and onpagehide of page1 <<< the audio is not heard, but is still running in the background. An average of between 450 to 525 milliseconds of audio is not heard during this interval. One more such interval is when we come back to page1 from page2. >>>onpagebeforeshow of page1 and onpagehide of page2<<< I guess this problem occurs while the persistent DOM cache is being retrieved back. Can you please check this.
Lakshmi Grandhi
sorry for responding late, i will look into issue
Lakshmi Grandhi
Does the audio plays even in page2?? I tried the code by setting data-dom-cache="true" in both pages. _page1_page.prototype.onpagebeforecreate = function(event) { console.log("inside page1.js"); var song = document.createElement("audio"); song.setAttribute("id", "song_stream"); song.setAttribute("controls","controls"); song.setAttribute("src", "/opt/media/Sounds/Kurivippina.mp3") document.getElementById("div2").appendChild(song); }; _page1_page.prototype.button1_ontap = function(event) { console.log("list button tap"); pageManager.changePage("page2",{ transition: "slide", reverse:true }); }; I didn't face any such issue, it resumed where it got paused.
Uday Bhaskar D
Its strange, for me, the audio continues to play in page2, although there is no audio element in it. I just wanted an audio element in page1 and the list of songs in page2. So in page1, my code creates an audio element in the onpagebeforecreate event. Scans for audio using content manager (saves the array of audio objects) , sets the audio to source of the first song during the onpageinit event. Upon clicking an image, it goes to page2 and populates the array of audio object information in a swipe list, inside the onpageinit event of page2. So the audio element in page1 and the list in page2 are saved in DOM cache and so don't have to be created again. When I click the back button in page2, it comes back to page1. The first song continues to play during the whole time unless I manually pause it.
Uday Bhaskar D
Can you check and rule out if the emulator is causing the problem ? We'll have to wait for a while before testing the app on a device. Can you try minimizing and maximizing the emulator and check if there is any interrupt in audio ? That's because I have that issue too.
Lakshmi Grandhi
I have test app on developer device, i observed one sec jump in case of device. Audio is not playing in page 2. Please let me know i need to test any thing else.
Uday Bhaskar D
Thank you so much for your help.
Lakshmi Grandhi
can you try using startVideoCapture and stopVideoCapture example from the url https://members.wholesaleappcommunity.com/currentspecs/deviceapis/camera.html. I dont have webcam or device to test it. I will forward this post to another developer Thanks Lakshmi