[Audio] Use MP3 format instead of OGG when using IE browsers
This commit is contained in:
@@ -27,7 +27,6 @@
|
|||||||
[UI]
|
[UI]
|
||||||
- handle internationalization
|
- handle internationalization
|
||||||
[Settings]
|
[Settings]
|
||||||
- increase the menu's width / add margins
|
|
||||||
- logout users that are being changed (loss of admin admin rights), or make sure they are still admin when they make changes
|
- logout users that are being changed (loss of admin admin rights), or make sure they are still admin when they make changes
|
||||||
- "signal not exposed" problem if a user logout and login again. bad resource destruction?
|
- "signal not exposed" problem if a user logout and login again. bad resource destruction?
|
||||||
[user/transcoding]
|
[user/transcoding]
|
||||||
@@ -43,8 +42,7 @@
|
|||||||
- MediaPlayer: move slider using js (http://redmine.webtoolkit.eu/boards/2/topics/7924?r=8478)
|
- MediaPlayer: move slider using js (http://redmine.webtoolkit.eu/boards/2/topics/7924?r=8478)
|
||||||
- TrackView : handle duration > 1 hour
|
- TrackView : handle duration > 1 hour
|
||||||
- TrackView : Reselect the current selected item when displaying the updated search results
|
- TrackView : Reselect the current selected item when displaying the updated search results
|
||||||
- Add Year column in the release filter. Add covers too?
|
- Add covers in the release filter?
|
||||||
- Save/Load playlists
|
|
||||||
|
|
||||||
[Video]
|
[Video]
|
||||||
- implement a decent mediaplayer
|
- implement a decent mediaplayer
|
||||||
|
|||||||
@@ -154,8 +154,6 @@ InputFormatContext::getPictures(std::vector<Picture>& pictures) const
|
|||||||
else
|
else
|
||||||
picture.mimeType = "application/octet-stream";
|
picture.mimeType = "application/octet-stream";
|
||||||
|
|
||||||
LMS_LOG(MOD_AV, SEV_DEBUG) << "MIME set to '" << picture.mimeType << "'" << std::endl;
|
|
||||||
|
|
||||||
AVPacket pkt = native()->streams[i]->attached_pic;
|
AVPacket pkt = native()->streams[i]->attached_pic;
|
||||||
|
|
||||||
std::copy(pkt.data, pkt.data + pkt.size, std::back_inserter(picture.data));
|
std::copy(pkt.data, pkt.data + pkt.size, std::back_inserter(picture.data));
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const std::vector<Format> Format::_supportedFormats
|
|||||||
{
|
{
|
||||||
{Format::OGA, Format::Audio, "audio/ogg", "Ogg"},
|
{Format::OGA, Format::Audio, "audio/ogg", "Ogg"},
|
||||||
{Format::OGV, Format::Video, "video/ogg", "Ogg"},
|
{Format::OGV, Format::Video, "video/ogg", "Ogg"},
|
||||||
{Format::MP3, Format::Audio, "audio/mp3", "MP3"},
|
{Format::MP3, Format::Audio, "audio/mpeg", "MP3"},
|
||||||
{Format::WEBMA, Format::Audio, "audio/webm", "WebM"},
|
{Format::WEBMA, Format::Audio, "audio/webm", "WebM"},
|
||||||
{Format::WEBMV, Format::Video, "video/webm", "WebM"},
|
{Format::WEBMV, Format::Video, "video/webm", "WebM"},
|
||||||
{Format::FLV, Format::Video, "video/x-flv", "Flash Video"},
|
{Format::FLV, Format::Video, "video/x-flv", "Flash Video"},
|
||||||
|
|||||||
@@ -27,13 +27,6 @@
|
|||||||
namespace Transcode
|
namespace Transcode
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string
|
|
||||||
getMimeType(Format format)
|
|
||||||
{
|
|
||||||
//TODO
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
Parameters::Parameters(const InputMediaFile& inputMediaFile,
|
Parameters::Parameters(const InputMediaFile& inputMediaFile,
|
||||||
const Format& outputFormat)
|
const Format& outputFormat)
|
||||||
:
|
:
|
||||||
|
|||||||
+12
-1
@@ -502,7 +502,18 @@ Audio::playTrack(boost::filesystem::path p)
|
|||||||
|
|
||||||
Transcode::InputMediaFile inputFile(p);
|
Transcode::InputMediaFile inputFile(p);
|
||||||
|
|
||||||
Transcode::Parameters parameters(inputFile, Transcode::Format::get(Transcode::Format::OGA));
|
// Determine the output format using the encoding of the player
|
||||||
|
Transcode::Format::Encoding encoding;
|
||||||
|
switch(AudioMediaPlayer::getEncoding())
|
||||||
|
{
|
||||||
|
case Wt::WMediaPlayer::MP3: encoding = Transcode::Format::MP3; break;
|
||||||
|
case Wt::WMediaPlayer::M4A: encoding = Transcode::Format::M4A; break;
|
||||||
|
case Wt::WMediaPlayer::OGA: encoding = Transcode::Format::OGA; break;
|
||||||
|
default:
|
||||||
|
encoding = Transcode::Format::MP3;
|
||||||
|
}
|
||||||
|
|
||||||
|
Transcode::Parameters parameters(inputFile, Transcode::Format::get(encoding));
|
||||||
|
|
||||||
parameters.setBitrate(Transcode::Stream::Audio, bitrate);
|
parameters.setBitrate(Transcode::Stream::Audio, bitrate);
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,24 @@
|
|||||||
#include <Wt/WTemplate>
|
#include <Wt/WTemplate>
|
||||||
#include <Wt/WHBoxLayout>
|
#include <Wt/WHBoxLayout>
|
||||||
#include <Wt/WVBoxLayout>
|
#include <Wt/WVBoxLayout>
|
||||||
|
#include <Wt/WApplication>
|
||||||
|
#include <Wt/WEnvironment>
|
||||||
|
|
||||||
#include "AudioMediaPlayer.hpp"
|
#include "AudioMediaPlayer.hpp"
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
|
Wt::WMediaPlayer::Encoding
|
||||||
|
AudioMediaPlayer::getEncoding()
|
||||||
|
{
|
||||||
|
const Wt::WEnvironment& env = Wt::WApplication::instance()->environment();
|
||||||
|
|
||||||
|
if (env.agentIsIE())
|
||||||
|
return Wt::WMediaPlayer::MP3;
|
||||||
|
else
|
||||||
|
return Wt::WMediaPlayer::OGA;
|
||||||
|
}
|
||||||
|
|
||||||
AudioMediaPlayer::AudioMediaPlayer( Wt::WContainerWidget *parent)
|
AudioMediaPlayer::AudioMediaPlayer( Wt::WContainerWidget *parent)
|
||||||
: Wt::WContainerWidget(parent),
|
: Wt::WContainerWidget(parent),
|
||||||
_mediaResource(nullptr)
|
_mediaResource(nullptr)
|
||||||
@@ -98,7 +111,7 @@ AudioMediaPlayer::AudioMediaPlayer( Wt::WContainerWidget *parent)
|
|||||||
controlsLayout->addWidget(shuffle);
|
controlsLayout->addWidget(shuffle);
|
||||||
|
|
||||||
_mediaPlayer = new Wt::WMediaPlayer( Wt::WMediaPlayer::Audio, btnContainer );
|
_mediaPlayer = new Wt::WMediaPlayer( Wt::WMediaPlayer::Audio, btnContainer );
|
||||||
_mediaPlayer->addSource( Wt::WMediaPlayer::OGA, "" );
|
_mediaPlayer->addSource( getEncoding(), "" );
|
||||||
_mediaPlayer->ended().connect(this, &AudioMediaPlayer::handleTrackEnded);
|
_mediaPlayer->ended().connect(this, &AudioMediaPlayer::handleTrackEnded);
|
||||||
|
|
||||||
_mediaPlayer->setControlsWidget( 0 );
|
_mediaPlayer->setControlsWidget( 0 );
|
||||||
@@ -142,7 +155,7 @@ AudioMediaPlayer::loadPlayer(void)
|
|||||||
_mediaResource = new AvConvTranscodeStreamResource( *_currentParameters, this );
|
_mediaResource = new AvConvTranscodeStreamResource( *_currentParameters, this );
|
||||||
_mediaInternalLink.setResource( _mediaResource );
|
_mediaInternalLink.setResource( _mediaResource );
|
||||||
|
|
||||||
_mediaPlayer->addSource( Wt::WMediaPlayer::OGA, _mediaInternalLink );
|
_mediaPlayer->addSource( getEncoding(), _mediaInternalLink );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ class AudioMediaPlayer : public Wt::WContainerWidget
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Encoding is set based on environment
|
||||||
|
static Wt::WMediaPlayer::Encoding getEncoding();
|
||||||
|
|
||||||
AudioMediaPlayer( Wt::WContainerWidget *parent = 0);
|
AudioMediaPlayer( Wt::WContainerWidget *parent = 0);
|
||||||
|
|
||||||
void load(const Transcode::Parameters& parameters);
|
void load(const Transcode::Parameters& parameters);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ AvConvTranscodeStreamResource::handleRequest(const Wt::Http::Request& request,
|
|||||||
LMS_LOG(MOD_UI, SEV_DEBUG) << "Launching transcoder";
|
LMS_LOG(MOD_UI, SEV_DEBUG) << "Launching transcoder";
|
||||||
transcoder = std::make_shared<Transcode::AvConvTranscoder>( _parameters);
|
transcoder = std::make_shared<Transcode::AvConvTranscoder>( _parameters);
|
||||||
|
|
||||||
|
LMS_LOG(MOD_UI, SEV_DEBUG) << "Mime type set to '" << _parameters.getOutputFormat().getMimeType() << "'";
|
||||||
response.setMimeType(_parameters.getOutputFormat().getMimeType());
|
response.setMimeType(_parameters.getOutputFormat().getMimeType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user