I am having an issue with Spotify preview links, they are not playing using AVPlayer.
var aSongURL: String = String(format: "https://p.scdn.co/mp3-preview/2d933f6474345c8af7e164356f30f450d0fc1309?cid=5e9ac4fc700442599e05f987a9cb1d4a")
var aPlayerItem: AVPlayerItem = AVPlayerItem(url: NSURL(string: aSongURL)! as URL)
var anAudioStreamer: AVPlayer = AVPlayer(playerItem: aPlayerItem)
anAudioStreamer.play()
It's a MP3, why is it not supported by AVPlayer, any ideas?
Try the method described here. It worked for me for your URL.
Related
I'm trying to play a live stream which is .m3u8 file and using embed text tracks in it. (I mean the text track is wrapped with video segment in the same .ts file) It works well on videoElement since I could access textTrack with videoElement.textTracks. However, When I cast it to chromecast, the text tracks is not show up.
Here is code snippet:
Sender:
const englishSubtitle = new chrome.cast.media.Track('1', // track ID
window.chrome.cast.media.TrackType.TEXT);
englishSubtitle.subtype = chrome.cast.media.TextTrackType.CAPTIONS;
englishSubtitle.name = 'English';
englishSubtitle.language = 'en-US';
englishSubtitle.customData = null;
englishSubtitle.trackContentId = '1';
englishSubtitle.trackContentType = 'text/vtt';
mediaInfo.tracks = [englishSubtitle];
}
const loadRequest = new chrome.cast.media.LoadRequest(mediaInfo);
Receiver:
const textTracksManager = this.playerManager.getTextTracksManager();
const tracks = textTracksManager.getTracks();
textTracksManager.setActiveByIds([tracks[0].trackId]);
BTW: This configuration works well when casting an VOD content. But we use out band text tracks in VOD. (I mean we use an separate vtt file URL)
I have a small application. I am opening youtube in webview and see the videos.
Everything is good but when I click the video it is opening new page and start video automaticly full screen.
I do not want auto start play video.
How can I do it?
My code:
let conf = WKWebViewConfiguration()
conf.allowsInlineMediaPlayback = false //Tried and Did not work
conf.requiresUserActionForMediaPlayback = true //Tried and Did not work
super.init(frame: CGRect.zero, configuration: conf)
Try it conf.allowsInlineMediaPlayback = true .
i developed Google chrome extension that contains Google TTS
i rewrite it with Crossrider to make it work in different platforms (it works great untill it comes to TTS part)
here is the code :
function PlayGoogleTTS(EngWord){
voices = speechSynthesis.getVoices();
msg = new SpeechSynthesisUtterance();
msg.volume = 1; // 0 to 1
msg.rate = 10; // 0.1 to 10
msg.pitch = 2; //0 to 2
msg.text = EngWord;
msg.lang = 'en-US';
msg.voice = voices[1];
msg.voice = voices[1]; // Note: some voices don't support altering params
speechSynthesis.speak(msg);
}
// Fetch the list of voices and populate the voice options.
function loadVoices() {
// Fetch the available voices.
var voices = speechSynthesis.getVoices();
}
// Chrome loads voices asynchronously.
window.speechSynthesis.onvoiceschanged = function(e) {
loadVoices();
};
so how can i convert it to make it work on Crossrider?
It's not clear from your question which speechSynthesis library/api you are using. However, assuming it is based on Chrome's TTS API, the required "tts" permission is not available.
[Disclosure: I am a Crossrider employee]
it's considered workaround more than an answer
just used another TTS that able to generate ogg maves in firefox
In my windows store app I used Windows.Media.Capture.CameraCaptureUI class to capture Images and Videos. The recorded videos are working fine in Windows environment. But the same recorded file is not played well in Ipad.
I will include the code here
CameraCaptureUI dialog = new CameraCaptureUI();
dialog.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
dialog.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;
dialog.VideoSettings.MaxResolution = CameraCaptureUIMaxVideoResolution.LowDefinition;
StorageFile capturedMedia = null;
if( _showVideo )
capturedMedia = await dialog.CaptureFileAsync(CameraCaptureUIMode.PhotoOrVideo);
else
capturedMedia = await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo);
Please help.
This looks more like a bug report. Sometimes there are bugs.
This is something you should report at http://connect.microsoft.com than here.
Your contribution to Connect helps other developers.
Can I use the Default Media Receiver to display a web page or an HTML5 app? Using Javascript in the Chrome browser, I have no problem sending a single png image (content type image/png) to the Chromecast but it fails if I specify an html link (content type text/html). session.loadMedia will fire the error handler and e.code/e.description reports session_error/LOAD_FAILED. I used Google's home page for my test:
//var currentMediaURL = "https://www.google.com/images/srpr/logo11w.png";
//var currentMediaType = "image/png";
var currentMediaURL = "https://www.google.com";
var currentMediaType = "text/html";
function startApp()
{
var mediaInfo = new chrome.cast.media.MediaInfo(currentMediaURL, currentMediaType);
var request = new chrome.cast.media.LoadRequest(mediaInfo);
session.loadMedia(request, onMediaDiscovered.bind(this, 'loadMedia'), onMediaError);
};
I think you need to have custom receiver, just have it run your code accordingly...