I have created an application for my Samsung TV 2011 (Maple 6.0).
It is a Javascript Web App that does not depend on anything other than jquery, I handle navigation and remote key events myself with my own functions; I use in combination with TVKeyValue.js and Widget.js.
Now I am trying to play video. On the emulators up to 2013 (The oldest emulator available it seems) it works fine with video.js. It looks like it is not supported in the Maple.
However, I could get video to work if I include the Samsung Apps Framework:
I could get the video to play, however I need to add the Scene folders and app.json in order for the app to run. Then I could play my video. The problem is that it breaks the standard javascript code. JSON is not defined, html data attributes do not work.
So my question is, how can I maintain my application as a javascript webapp, while still being able to play video via the 2011 tv running maple?
HTML4 is whats supported so video tags do not work, and flash it says plugin required. So there does not seem to be any video solutions for non AF samsung apps.
On Samsung devices is better solution then video tag using SEF player
http://www.samsungdforum.com/Guide/?FolderName=API00005&FileName=Player_29.html
(Player item)
Related
I am using waveform-playlist to create a multi track player similar to ones you'll see on music editing software such as GarageBand, FL Studios, Ableton, etc. Using the library waveform-playlist I was able to set everything up with no problem. However, on mobile devices, it would crash after trying to interact with the pause or stop buttons on the app whilst the audio is playing. I'm assuming it's a memory leak issue. Any ideas on how I can start to debug this or how to fix this since the console on chrome mobile is very basic and doesn't return any errors.
Here is the deployed app that I'm testing on https://subtle-frangollo-452f91.netlify.app/
Here is the library I'm using to make this: https://github.com/naomiaro/waveform-playlist
I am creating a game using Construct 2, but on previewing on Android smartphone, I found Audio playback and delay issue:
This is possibly the curse of Web Audio API in that many browsers require user to touch the screen first or no music will be played. Worse, if another music is to be played, the user must touch the screen once again. This is "by design" of these smartphone browsers. Only Firefox seems to allow music to be played without user initiated touch.
I've seen that this issue has been covered for several times (ex. Website HTML 5 Audio Autoplay and https://stackoverflow.com/a/22331782/144201) and some of the possible suggestions include using other audio javascript libraries entirely such as SoundJS and howler.js.
Has anyone have experience bringing in such audio library that could solve the issue above for Cordova Android export option? Does it work for all Android devices? In fact, can anyone provide me a link for a HTML5 game/page/app, exported with C2 that uses such audio library and play music without requiring user's initial touch on Android so I could check? I just want a confirmation that this is truly possible.
Or is there a more elegant way for Construct 2?
Previewing on browser has the "user must touch screen once" issue because of it is "by design". But if the C2 app is exported via Cordova and uses Crosswalk, the game can play the music without requiring the user to ever touch the screen first.
See https://www.scirra.com/tutorials/809/how-to-export-to-android-with-crosswalk . Although the tutorial is outdated for the current Intel XDK, the instruction is more or less the same. However, the newer C2 versions also create an .xdk file upon Cordova export. In the Intel XDK, you must "Open an Intel XDK project" instead of "Import an existing HTML5 project". See https://software.intel.com/en-us/forums/intel-xdk/topic/607195 for more info.
I'm using a .mp3 file, the .mp3 file plays okay when viewed directly and also when embeded using the HTML5 audio tag, however when creating the HTML5 audio tag in JS it does not play! (very strange)
I do not have this issue in any other browser/device, for example Desktop - Chrome works perfectly.
sound = document.createElement('audio');
sound.setAttribute('src', 'sound.mp3');
sound.play();
I've tested sound.canPlayType('audio/mpeg') and this produces true (so it is supported).
Perhaps there's a bug in Android - Chrome? (it is the latest version)
Looks like this is intended feature that spans more then just the Chrome browser. User interaction is required to get media elements to play.
Blink and WebKit have a setting for requiring a “user gesture” to play or pause an audio or video element, which is enabled in Opera for Android, Chrome for Android, the default Android browser, Safari for iOS and probably other browsers. This makes some sense, since mobile devices are used in public and in bed, where unsolicited sound from random Web sites could be a nuisance. Also, autoplaying video ads would waste bandwidth. Block Quote from 'blog.foolip.org'
Duplicate Threads from Other Users
Autoplay audio on mobile safari
How can I autoplay media in ios 4.2.1
Autoplay audio with ios 5 workaround?
Current Status
Developers have requested the deletion of 'mediaPlaybackRequiresUserGesture' which was reviewed and denied (for now). "We're going to gather some data about how users react to autoplaying videos in order to decide whether to keep this restriction."
Upon further inspection i found this...
"I misunderstood the outcome of the discussion (removing mediaPlaybackRequiresUserGesture) surrounding this topic. We need to keep this code in order to not break google.com while gathering data about this feature."
Google.com relies on the feature being disabled, otherwise it breaks (they didn't say what it breaks).
Original Bug Report
Try appending it to the document body.
document.body.appendChild(sound);
Though it is possible that mobile devices will not automatically play the audio or videos. If you are targeting mobile devices, autoplaying is considered bad practice since it can consume bandwidth. So it may be worth considering adding controls.
sound.setAttribute('controls', 'true');
OK, well, now that we know it won't work with audio, the only path left to you is to switch to the Web Audio API. You'll need to load the mp3 into an ArrayBuffer (e.g. using an XHR), then pass that to the decodeAudioData method, which gets you an Audio buffer that you can play back at will from an AudioBufferSourceNode.
Not every browser on every platform can play the mp3 audio format. Generally, as I would recommend, you should provide two <source> elements within your audio element, one providing the mp3 format, and another one providing the ogg vorbis format.
You can read more here: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
I'm writing a platform with an audio playback component. Audio is uploaded to the server as an wav/mp3/ogg file, and then (like the rest of our media), converted to base64 and stored within our redis database.
To play the audio back at the client side we make an AJAX request to the server for the base64 encoded audio. We have a desktop version that compliments the mobile application, at the moment audio playback works like this:
recording.sound = new Audio("data:audio/ogg;base64," + recording.audio);
recording.sound.play(); // this works
Today we started our tests on mobile devices, and have so far been unable to get it working, even on mobile browsers that apparently support HTML5 audio.
Any ideas? Or if this is not possible, is there a different approach we can take? Ideally there should be a mobile compatible version of the web app, and there has to be a phonegap version.
The reason might not be a technical one here, from Apple developer site:
In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.
same applies to Android devices.
read more here: Safari HTML5 Audio and Video Guide
But „audio/wav“ doesn't exist. See spec here: http://www.iana.org/assignments/media-types/audio
You should use „audio/vnd.dts“ for .wav file, „audio/mpeg“ for .mp3 file and „audio/ogg“ for .ogg file...
OK, try StackOverflow search, see:
https://stackoverflow.com/search?q=audio+codec+support+mobile+devices+html5
or https://stackoverflow.com/search?q=audio+codec+support+mobile+devices+html
or try Google
Some search results, that might be useful:
In search for a library that knows to detect support for specific Audio Video format files
or html5 vs flash - full comparison chart anywhere?
I'm trying to get SoundManager2 to work on Android, but so far it will not play any audio. Does anyone know if there is any way to get this to work on Android without flash being present? If so, please could you provide an example or a page that discusses the issues around this.
Verify that html5 audio support is there in 2.2 by going to http://html5test.com/
I have Froyo (2.2) on Milestone and the page says audio-element: yes but No to PCM, mp3, AAC, Ogg, WebM. This is probably the reason why it is not working.
I assume that you are using the latest version of SoundManager2 (V2.97a.20110306 - HTML5 audio updates, Flash/HTML5 mode detection, IE flash init tweaks, reuse and instance options fixes). The revision history says "HTML5 audio: If no flash, try forcing useHTML5Audio = true (eg. desktop
safari on new Macs which don't come with Flash.) Related: flash detection code tweak."
But it is better to explicitly specify soundManager.useHTML5Audio = true; in the script or useHTML5Audio :true when you call soundManager.createSound(). This will ensure that SoundManager2 is not the reason why html5-audio is not working.
I visited the http://html5test.com/ on my Galaxy S2 from T-mobile in the default web browser provided by Google (on Android 2.e.6). It said 189 and 1 bonus point out of 500 points. It also said it supported mp3 playing. The REAL test came when I actually visited the soundmanager2 website at http://www.schillmania.com/projects/soundmanager2/ on this same phone and tried their demos. The examples do NOT work on my phone. Oh well.