语言

Menu
Sites
Language
Can't play audio in z2

Help..
I have a problem my apps can't play audio in Z2, but this good running in emulator. I'm using audio source in html5.

$('.song').on('click', function(env){
   var audio = new Audio();
   audio.setAttribute('src', $(this).data('song-url')+ '?client_id=' + SC_CLIENT);
   audio.load();
   audio.play();
});

 

响应

6 回复
Marco Buettner

It looks like "song-url" required internet features? Did u setup the config.xml with privileg/internet and network access to the domain or * ?

reky susanto
This my config.xml
  <tizen:application id="SntshzMM98.Muzic" package="SntshzMM98" required_version="2.4"/>
    <author href="rekysusanto.xyz" email="reckysu@gmail.com">reky susanto</author>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <feature name="http://tizen.org/feature/network.wifi"/>
    <feature name="http://tizen.org/feature/network.telephony"/>
    <icon src="Music-icon.png" height="117" width="117"/>
    <name>Muzic</name>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/location"/>
    <tizen:privilege name="http://tizen.org/privilege/volume.set"/>
    <tizen:profile name="mobile"/>

 

Marco Buettner

I cant find anything about network access ... please configure it on the network tab the access network table and add the specific domain(s) or use * as wildcard for ANY domain.

reky susanto

Configuration like this?

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://muzic.rekysusanto.xyz" version="1.0.0" viewmodes="maximized">
    <access origin="*" subdomains="true"/>
    <tizen:application id="SntshzMM98.Muzic" package="SntshzMM98" required_version="2.4"/>
    <author href="http://rekysusanto.xyz" email="reckysu@gmail.com">reky susanto</author>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <feature name="http://tizen.org/feature/network.wifi"/>
    <feature name="http://tizen.org/feature/network.telephony"/>
    <icon src="Music-icon.png" height="117" width="117"/>
    <name>Muzic</name>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/location"/>
    <tizen:privilege name="http://tizen.org/privilege/volume.set"/>
    <tizen:profile name="mobile"/>
    <tizen:setting screen-orientation="portrait" context-menu="disable" background-support="enable" encryption="disable" install-location="auto" hwkey-event="enable"/>
</widget>

 

Marco Buettner

Looks good... Did u get any error? 

Also u dont need to setup setAttribute('src') ... HTMLMediaElement has directly access of the src-Attribute via 

var audio = new Audio();
audio.src = source;

 

reky susanto

I'm already change it, but my app still playing audio stream.
So i have question, whether tizen web-application can playing the audio stream like SoundCloud?